﻿@model KL.Store.Web.Models.CartCheckOutModel
@using KL.Store.Core;
@using KL.Store.Data;
@using KL.Store.Core.Domain;
@using KL.Store.Core.Domain.Enum;
@{
    var checkOutStyle = 0;
    if (Parameters.Theme == "HA")
    {
        checkOutStyle = 1;
    }
    var processesHidden = false;
    var addrStyle = "";
    var paymentStyle = "display:none;";
    if (Model.AddressCompleted == 1)
    {
        addrStyle = "display:none;";
        paymentStyle = "";
    }
    var ctypeclass = "";
    var ctypeprepare = false;
    if (!string.IsNullOrEmpty(Model.CardNumber1))
    {
        var c1firstchar = Model.CardNumber1.Substring(0, 1);
        switch (c1firstchar)
        {
            case "3": ctypeclass = "amex"; ctypeprepare = true; break;
            case "4": ctypeclass = "visa"; ctypeprepare = false; break;
            case "5": ctypeclass = "mastercard"; ctypeprepare = false; break;
            default: ; break;
        }
    }
    var disableOtherPaymentForOpportunity = (Model.OppoturnityProductsAvailable && Parameters.OnlyUseCCandMTforOpportunityProduct) ? true : false;
}
@if (Parameters.Theme == "DK" || Parameters.Theme == "EO")
{ 
    <h1>Sepeti Onayla</h1>   
}
@if (Model.ItemCount <= 0)
{
    <div class="bg-info bs-bg" style="margin-bottom: 15px;">
        <p><span class="glyphicon glyphicon-info-sign"></span>Sepetinizde ürün bulunmamaktadır.</p>
    </div>
}
else
{
    using (Ajax.BeginForm("Refresh", "Cart", new { }, new AjaxOptions { UpdateTargetId = "checkoutForm", HttpMethod = "Post", LoadingElementId = "LoadingTotal, #LoadingTotalWithCreditCard, #LoadingTotalWithTransfer, #Loading2" }, new { id = "frmRefresh", name = "frmRefresh", @class = "form-horizontal" }))
    {
    @Html.HiddenFor(m => m.SelectedAction, new { @autocomplete = "off" })
    @Html.HiddenFor(m => m.PaymentType, new { @autocomplete = "off" })
    @Html.HiddenFor(m => m.SelectedPos, new { @autocomplete = "off" })
    @Html.HiddenFor(m => m.SelectedInstallment, new { @autocomplete = "off" })
    @Html.HiddenFor(m => m.SelectedCargoCompanyId, new { @autocomplete = "off" })
        if (checkOutStyle != 1)
        {
    @Html.HiddenFor(m => m.SelectedBank, new { @autocomplete = "off" })         
        }
    @Html.HiddenFor(m => m.Type3D, new { @autocomplete = "off" })
    @Html.HiddenFor(m => m.MaxInstallmentCount, new { @autocomplete = "off" })
    @Html.HiddenFor(m => m.AddressCompleted, new { @autocomplete = "off" })
    @Html.HiddenFor(m => m.VoucherAvailable, new { @autocomplete = "off" })
    @Html.HiddenFor(m => m.VisitorRegistered, new { @autocomplete = "off" })
    @Html.HiddenFor(m => m.AgreementChecked, new { @autocomplete = "off" })
    @Html.HiddenFor(m => m.GuarantorNotSelectedAgreed, new { @autocomplete = "off" })
    

        if (checkOutStyle == 1)
        {
    <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 first last chkaddrcarg" style="@addrStyle">
        @*ADRES-KARGO*@
        @*ADDR1.ST*@
        @if (Model.UserType == 1)
        {
            <div class="checkOut-section col-xs-6">
                <h3>Üyeliksiz Alışveriş<div id="LoadingTotalWithCreditCard" class="LoadingSmall right">
                    <img src="/Images/@(Parameters.Theme)/loadingSmall.gif" alt="Loading" />
                </div>
                </h3>
                <h4>&nbsp;</h4>
                <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 checkout-personel-informations first last">
                    <div class="col-md-6 first last">
                        @Html.LabelFor(m => m.FirstName)
                        @Html.TextBoxFor(m => m.FirstName, new { @class = "form-control" })
                    </div>
                    <div class="col-md-6 last">
                        @Html.LabelFor(m => m.LastName)
                        @Html.TextBoxFor(m => m.LastName, new { @class = "form-control" })
                    </div>
                    <div class="col-md-6 first last">
                        @Html.LabelFor(m => m.Email)
                        @Html.TextBoxFor(m => m.Email, new { @class = "form-control" })
                    </div>
                    <div class="col-md-6 last">
                        @Html.LabelFor(m => m.Mobile)
                        @Html.TextBoxFor(m => m.Mobile, new { @class = "form-control" })
                    </div>
                </div>
                <div class="clearfix"></div>
            </div>
            <div class="checkOut-section checkOut-login col-xs-6 last">
                <h3>Üye Girişi Yap<div id="LoadingTotalWithCreditCard" class="LoadingSmall right">
                    <img src="/Images/@(Parameters.Theme)/loadingSmall.gif" alt="Loading" />
                </div>
                </h3>
                <h4>Hızlı işlem; kayıtlı adreslerin otomatik görünür</h4>
                <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 checkout-login first last">
                    @if (!ViewData.ModelState.IsValid)
                    {
                        <div class="bg-danger first last">
                            @Html.ValidationSummary(true, "Giriş işlemi başarısız oldu. Lütfen bilgileri kontrol ediniz.")
                        </div>
                    }
                    <div class="form-group col-xs-12 last">
                        <div class="col-md-6 first last">
                            <label for="LoginUserName">E-Posta Adresiniz</label>
                            <input type="text" name="LoginUserName" id="LoginUserName" class="form-control" />
                        </div>
                        <div class="col-md-6 last">
                            <label for="LoginPassword">Parolanız</label>
                            <input type="password" name="LoginPassword" id="LoginPassword" class="form-control" />
                        </div>
                    </div>
                    <div class="form-group col-xs-12 last">
                        <div class="col-md-6 last right alignright">
                            <a href="/Account/Login" class="btn btn-custom3">Kaydol&nbsp;<i class="fa fa-sign-in"></i></a>
                            <button type="button" class="btn btn-custom1 cartLoginButton">Giriş Yap&nbsp;<i class="glyphicon glyphicon-chevron-right"></i></button>
                        </div>
                    </div>
                </div>
                <script>
                    $('.cartLoginButton').click(function ()
                    {
                        var LoginPassword = $('#LoginPassword').val();
                        var LoginUserName = $('#LoginUserName').val();
                        $.ajax({
                            url: '/Account/LoginPartial',
                            type: 'POST',
                            data: {
                                Password: LoginPassword,
                                UserName: LoginUserName,
                                returnUrl: 'Cart/CheckOut'
                            },
                            success: function (result)
                            {
                                if (result.url)
                                {
                                    window.location.href = result.url;
                                }
                                else
                                {
                                    alert('Girdiğiniz bilgiler hatalı.');
                                }
                            }
                        });
                    });
                    $('#LoginPassword, #LoginUserName').on("keyup keypress", function (e)
                    {
                        var code = e.keyCode || e.which;
                        if (code == 13)
                        {
                            e.preventDefault();
                            return false;
                        }
                    });
                </script>
                <div class="clearfix"></div>
            </div>
            <div class="clearfix"></div>
            <hr />
        }
        <div class="checkOut-section col-md-4">
            <h3>Teslimat Adresim<div id="LoadingTotalWithCreditCard" class="LoadingSmall right">
                <img src="/Images/@(Parameters.Theme)/loadingSmall.gif" alt="Loading" />
            </div>
            </h3>
            <ul class="checkOut-address-list">
                <li>
                    @Html.DropDownListFor(m => m.CargoAddressId, new SelectList(Model.CargoAddresses, "AddressID", "AddressName"), new { onchange = "frmSubmit(0)", @class = "form-control", @style = "width:150px;" })
                </li>
                <li>
                    <a class="btn btn-custom3 addToCart addressEdit" onclick="updateAddress(0)" href="#address-update">Yeni</a>
                </li>
            </ul>
            <div id="teslimAdres" class="checkout-address-content">
                @if (Model.CargoAddress.Address1 == null || Model.CargoAddress.City == 0)
                {
                    <div class="bs-bgbs bg-danger">
                        <p>
                            <span class="glyphicon glyphicon-info-sign"></span>&nbsp;Devam edebilmek için lütfen teslimat adresi ekleyin.
                        </p>
                    </div>
                }
                <h4>@(Html.Raw(string.IsNullOrEmpty(Model.CargoAddress.AddressName) ? "<span class=\"addrlabel\">Adı ve Soyadı</span>" + Model.UserName + "" : "<span class=\"addrlabel\">Seçilen Adres</span>" + Model.CargoAddress.AddressName + ""))</h4>
                <span class="addrlabel">Adres:</span>@(Html.Raw(string.IsNullOrEmpty(Model.CargoAddress.Address1) ? "-" : Model.CargoAddress.Address1 + ""))
                @(Html.Raw(string.IsNullOrEmpty(Model.CargoAddress.Address2) ? "" : " " + Model.CargoAddress.Address2 + " "))<br />
                <span class="addrlabel">Posta Kodu:</span>@(Html.Raw(string.IsNullOrEmpty(Model.CargoAddress.PostalCode) ? "-" : Model.CargoAddress.PostalCode + " "))<br />
                <span class="addrlabel">İlçe:</span>@(Html.Raw(string.IsNullOrEmpty(Model.CargoAddress.County) ? "-" : Model.CargoAddress.County + " / "))<br />
                <span class="addrlabel">İl:</span>@(Html.Raw(string.IsNullOrEmpty(Model.CargoAddress.CityName) ? "-" : Model.CargoAddress.CityName + " / "))<br />
                <span class="addrlabel">Ülke:</span>@(Html.Raw(string.IsNullOrEmpty(Model.CargoAddress.CountryName) ? "-" : Model.CargoAddress.CountryName))<br />
                <br />
                <a onclick="updateAddress(@Model.CargoAddressId)" class="addressEdit btn btn-custom3" href="#address-update"><span>Güncelle</span></a>
            </div>
        </div>
        @*ADDR1.FN*@
        @*ADDR2.ST*@
        <div class="checkOut-section col-md-4">
            <h3>Fatura Adresim<div id="LoadingTotalWithCreditCard" class="LoadingSmall right">
                <img src="/Images/@(Parameters.Theme)/loadingSmall.gif" alt="Loading" />
            </div>
            </h3>
            <ul class="checkOut-address-list">
                <li>
                    @Html.DropDownListFor(m => m.InvoiceAddressId, new SelectList(Model.CargoAddresses, "AddressID", "AddressName"), new { onchange = "frmSubmit(0)", @class = "form-control", @style = "width:150px;" })</li>
                <li>
                    <a class="btn btn-custom3 addToCart addressEdit" onclick="updateAddress(0)" href="#address-update">Yeni</a>
                </li>
            </ul>
            <div id="faturaAdres" class="checkout-address-content">
                @if (Model.InvoiceAddress.Address1 == null || Model.InvoiceAddress.City == 0)
                {
                    <div class="bs-bgbs bg-danger">
                        <p>
                            <span class="glyphicon glyphicon-info-sign"></span>&nbsp;Devam edebilmek için lütfen teslimat adresi ekleyin.
                        </p>
                    </div>
                }
                <h4>@(Html.Raw(string.IsNullOrEmpty(Model.InvoiceAddress.AddressName) ? "<span class=\"addrlabel\">Adı ve Soyadı</span>" + Model.UserName + "" : "<span class=\"addrlabel\">Seçilen Adres:</span>" + Model.InvoiceAddress.AddressName + ""))</h4>
                <span class="addrlabel">Adres:</span>@(Html.Raw(string.IsNullOrEmpty(Model.InvoiceAddress.Address1) ? "-" : "" + Model.InvoiceAddress.Address1 + ""))
                @(Html.Raw(string.IsNullOrEmpty(Model.InvoiceAddress.Address2) ? "" : " " + Model.InvoiceAddress.Address2 + ""))<br />
                <span class="addrlabel">Posta Kodu:</span>@(Html.Raw(string.IsNullOrEmpty(Model.InvoiceAddress.PostalCode) ? "-" : "" + Model.InvoiceAddress.PostalCode + ""))<br />
                <span class="addrlabel">İlçe:</span>@(Html.Raw(string.IsNullOrEmpty(Model.InvoiceAddress.County) ? "-" : "" + Model.InvoiceAddress.County + ""))<br />
                <span class="addrlabel">İl:</span>@(Html.Raw(string.IsNullOrEmpty(Model.InvoiceAddress.CityName) ? "-" : "" + Model.InvoiceAddress.CityName + ""))<br />
                <span class="addrlabel">Ülke:</span>@(Html.Raw(string.IsNullOrEmpty(Model.InvoiceAddress.CountryName) ? "-" : "" + Model.InvoiceAddress.CountryName))<br />
                <br />
                <a onclick="updateAddress(@Model.InvoiceAddressId)" class="addressEdit btn btn-custom3" href="#address-update"><span>Güncelle</span></a>
                @if (Model.CargoAddress != null && Model.InvoiceAddress != null && Model.CargoAddress.AddressId != Model.InvoiceAddress.AddressId)
                { 
                    <br />
                    @Html.CheckBoxFor(model => model.CargoWithInvoice, new { onchange = "frmSubmit(0)" });
                    <text>Fatura, ürünlerin yanında gelsin</text>
                }
            </div>
        </div>
        @if (Model.InvoiceAddress.Address1 == null || Model.InvoiceAddress.City == 0 || Model.CargoAddress.Address1 == null || Model.CargoAddress.City == 0)
        {
            processesHidden = true;
        }
@*ADDR2.FN*@
@*CARGO.ST*@
        <div class="checkOut-section checkOut-cargo col-md-4" style="display: @(Model.SummaryCargo.CartItemCount > 0 ? "block" : "none")">
            @if (Model.TransportAvailable)
            {
                <div class="col-md-12 info-block-content info-block-content-last">
                    <div class="col-xs-2 first last info-block-icon">
                        <i class="fa fa-truck fa-4x"></i>
                    </div>
                    <div class="col-xs-10 last">
                        <span class="info-block-title">Teslimat</span>
                        <span class="info-block-text"><a target="_blank" class="bolder" href="/Icerik/Delivery">Nakliye ve Montaj Koşulları için Tıklayın</a></span>
                    </div>
                </div>
                <div class="col-md-12 info-block-content info-block-content-last">
                    <div class="col-xs-2 first last info-block-icon">
                        <i class="fa fa-phone fa-4x"></i>
                    </div>
                    <div class="col-xs-10 last">
                        <span class="info-block-title">Çağrı Merkezi</span>
                        <span class="info-block-phone">@(Parameters.PrimaryPhoneNumber)</span>
                    </div>
                </div>
            }
            else
            {
                <h3>Kargo Tercihim</h3>
                <ul class="checkout-cargo-select">
                    @{ decimal selectedCargoPrice;}
                    @foreach (var cargo in (Model.FreeCargoInCityAvailable ? Model.CargoList.Where(c => c.OnlyFreeCargoInCity) : Model.CargoList))
                    {
                        if (cargo.OnlyFreeCargoInCity && !Model.FreeCargoInCityAvailable)
                        {
                            continue;
                        }
                        selectedCargoPrice = KL.Store.Web.Controllers.CartController.CalculateCargoPrice(cargo.CargoId, Model.CargoAddress.City, Model.PaymentType, Model.UserId, Model.UserType);

                        <li>
                            <label>
                                @if (Model.SelectedCargoCompanyId == cargo.CargoId)
                                {
                                    @Html.RadioButtonFor(model => model.SelectedCargoCompanyId, @cargo.CargoId, new { @onclick = "CargoSelect(" + cargo.CargoId + ")", @checked = "checked" });
                                }
                                else
                                {
                                    @Html.RadioButtonFor(model => model.SelectedCargoCompanyId, @cargo.CargoId, new { @onclick = "CargoSelect(" + cargo.CargoId + ")" });
                                }
                                @cargo.CargoName
                                <span>@selectedCargoPrice.ToString("###,###,##0.00 TL")</span>
                            </label>
                        </li>
                    }
                </ul>
            }
            <div class="clearfix"></div>
        </div>
        @*CARGO.FN*@
    </div>
    <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 first last">
        @if (!string.IsNullOrEmpty(Model.Message1) || !string.IsNullOrEmpty(Model.Message2) || !string.IsNullOrEmpty(Model.Message3) || !string.IsNullOrEmpty(Model.Message4) || !string.IsNullOrEmpty(Model.Message5) || !string.IsNullOrEmpty(Model.Message6) || !string.IsNullOrEmpty(Model.Message7) || !string.IsNullOrEmpty(Model.Message8) || !string.IsNullOrEmpty(Model.Message9) || !string.IsNullOrEmpty(Model.Message10) || !string.IsNullOrEmpty(Model.Message11) || !string.IsNullOrEmpty(Model.Message12))
        {
            <table style="width: 100%;">
                <tr>
                    <td style="border: none; width: 100%; padding-bottom: 20px;" colspan="2">
                        <div class="bg-danger checkoutErrors">
                            <p>İşleminiz gerçekleştirilirken aşağıdaki hata(lar) ile karşılaşıldı:</p>
                            <ul>
                                @(Html.Raw(string.IsNullOrEmpty(Model.Message1) ? "" : "<li>" + Model.Message1 + "</li>"))
                                @(Html.Raw(string.IsNullOrEmpty(Model.Message2) ? "" : "<li>" + Model.Message2 + "</li>"))
                                @(Html.Raw(string.IsNullOrEmpty(Model.Message3) ? "" : "<li>" + Model.Message3 + "</li>"))
                                @(Html.Raw(string.IsNullOrEmpty(Model.Message4) ? "" : "<li>" + Model.Message4 + "</li>"))
                                @(Html.Raw(string.IsNullOrEmpty(Model.Message5) ? "" : "<li>" + Model.Message5 + "</li>"))
                                @(Html.Raw(string.IsNullOrEmpty(Model.Message6) ? "" : "<li>" + Model.Message6 + "</li>"))
                                @(Html.Raw(string.IsNullOrEmpty(Model.Message7) ? "" : "<li>" + Model.Message7 + "</li>"))
                                @(Html.Raw(string.IsNullOrEmpty(Model.Message8) ? "" : "<li>" + Model.Message8 + "</li>"))
                                @(Html.Raw(string.IsNullOrEmpty(Model.Message9) ? "" : "<li>" + Model.Message9 + "</li>"))
                                @(Html.Raw(string.IsNullOrEmpty(Model.Message10) ? "" : "<li>" + Model.Message10 + "</li>"))
                                @(Html.Raw(string.IsNullOrEmpty(Model.Message11) ? "" : "<li>" + Model.Message11 + "</li>"))
                                @(Html.Raw(string.IsNullOrEmpty(Model.Message12) ? "" : "<li>" + Model.Message12 + "</li>"))

                            </ul>
                        </div>
                    </td>
                </tr>
            </table>
        }
    </div>
    <div style="@addrStyle" class="right">
        <button type="button" class="continueToPayment btn btn-custom1" onclick="continueToPayment();">Devam Et&nbsp;<i class="glyphicon glyphicon-chevron-right"></i></button>
    </div>
    <div class="col-xs-12 col-sm-12 col-md-12 col-lg-7 first last chksuccess" style="@paymentStyle">
        @*ÖZET-NOT-ONAYLA*@
        <div class="checkOut-section">
            <h3>Sipariş Özeti</h3>
            <div id="checkoutMinimalContent">
                @{Html.RenderAction("GetMinimal", "Cart", new { ShowAcrIcrLinks = true });}
            </div>
            <table class="table-responsive" id="checkOut-view" style="width: 100%;">
                <tbody>
                    <tr>
                        <td class="alignright">Sepet Tutarı :</td>
                        <td class="price alignright" width="110">@Model.SummaryCargo.CartTotalPrice.ToString("###,###,##0.00 TL")</td>
                    </tr>
                    @if (!Model.TransportAvailable)
                    {
                        if (Model.PaymentType == PaymentTypes.KapidaOdeme)
                        {
                            var KargoBedeli = Model.CargoPrice - Parameters.AdditionFeeForPaymentAtDoor;
                        <tr>
                            <td class="alignright">Kargo Bedeli :</td>
                            <td class="price alignright">@KargoBedeli.ToString("###,###,##0.00 TL")</td>
                        </tr>
                        <tr>
                            <td class="alignright">Kapıda Ödeme Bedeli :</td>
                            <td class="price alignright">@Parameters.AdditionFeeForPaymentAtDoor.ToString("###,###,##0.00 TL")</td>
                        </tr>
                        }
                        else
                        {
                        <tr>
                            <td class="alignright">Kargo Bedeli :</td>
                            <td class="price alignright">@Model.CargoPrice.ToString("###,###,##0.00 TL")</td>
                        </tr>
                        }
                    }
                    @if (Model.TransportAvailable)
                    {
                        <tr>
                            <td class="alignright">Nakliye Bedeli :</td>
                            <td class="price alignright">@Model.TransportPrice.ToString("###,###,##0.00 TL")</td>
                        </tr>
                    }
                    @if (Model.InstallationAvailable)
                    {
                        <tr>
                            <td class="alignright">Montaj Bedeli :</td>
                            <td class="price alignright">@Model.InstallationPrice.ToString("###,###,##0.00 TL")</td>
                        </tr>
                    }
                    <tr id="kktckodm" class="odmyntm" style="font-weight: bold;">
                        <td class="alignright">Tek Çekim Tutarı :</td>
                        <td class="price alignright">@Model.TotalPayment.ToString("###,###,##0.00 TL")</td>
                    </tr>
                    @if (Model.CargoPrice2 > 0)
                    {
                        <tr>
                            <td class="alignright">Hediye Ürün Kargo Payı :</td>
                            <td class="price alignright">
                                @Model.CargoPrice2.ToString("###,###,##0.00 TL")
                            </td>
                        </tr>                        
                    }
                    @if (Model.VoucherList.Count > 0)
                    {
                        if (Parameters.UseVoucher)
                        {
                            if (Parameters.UsePartialPayment)
                            { 
                        <tr>
                            <td class="groupheader alignright">Hediye Çeklerim ve Ara Ödemelerim :</td>
                            <td class="groupheader alignright">Tutar :</td>
                        </tr>
                            }
                            else
                            {
                        <tr>
                            <td class="groupheader alignright">Hediye Çeklerim :</td>
                            <td class="groupheader alignright">Tutar :</td>
                        </tr>
                            }
                        }
                        else if (Parameters.UsePartialPayment)
                        {
                        <tr>
                            <td class="groupheader alignright">Ara Ödemelerim :</td>
                            <td class="groupheader alignright">Tutar :</td>
                        </tr>
                        }
                        if (Parameters.UseVoucher || Parameters.UsePartialPayment)
                        {
                            for (int i = 0; i < Model.VoucherList.Count; i++)
                            {
                        <tr>
                            <td class="alignright">
                                @Html.HiddenFor(model => model.VoucherList[i].VoucherId)
                                @Html.CheckBoxFor(model => model.VoucherList[i].Selected, new { onchange = "frmSubmit(0)" })
                                @Model.VoucherList[i].TypeName - @Model.VoucherList[i].CreateDate
                            </td>
                            <td class="price alignright">
                                @Model.VoucherList[i].Payment.ToString("###,###,##0.00 TL")
                            </td>
                        </tr>
                            }
                        }
                    }
                </tbody>
                <tfoot>
                    @*<tr id="tkstodm">
                        <td class="alignright">Taksitli Ödeme Toplam Tutarı :</td>
                        <td class="price alignright">
                            <div style="position: relative; float: right; width: 100%">
                                <div class="LoadingSmall left" id="LoadingTotal" style="display: none;">
                                    <img alt="Loading" src="/Images/@Parameters.Theme/loadingSmall.gif" />
                                </div>
                                @Model.TotalPayment.ToString("###,###,##0.00 TL")
                            </div>
                        </td>
                    </tr>*@
                    @if (Model.TotalPaymentWithCreditCard > 0)
                    {
                        <tr id="kktckodm" class="odmyntm">
                            <td class="alignright">Kredi Kartı Tek Çekim Toplam Tutarı :</td>
                            <td class="price alignright">
                                <div style="position: relative; float: right; width: 100%">
                                    <div id="LoadingTotalWithCreditCard" class="LoadingSmall left">
                                        <img src="/Images/@(Parameters.Theme)/loadingSmall.gif" alt="Loading" />
                                    </div>
                                    @Model.TotalPaymentWithCreditCard.ToString("###,###,##0.00 TL")
                                </div>
                            </td>
                        </tr>
                    }
                    @if (Model.TotalPaymentWithTransfer > 0)
                    {
                        <tr id="hvlftodm" class="odmyntm">
                            <td class="alignright">Havale/EFT ile Ödenirse Toplam Tutar :</td>
                            <td class="price alignright">
                                <div style="position: relative; float: right; width: 100%">
                                    <div id="LoadingTotalWithTransfer" class="LoadingSmall left">
                                        <img src="/Images/@(Parameters.Theme)/loadingSmall.gif" alt="Loading" />
                                    </div>
                                    @Model.TotalPaymentWithTransfer.ToString("###,###,##0.00 TL")
                                </div>
                            </td>
                        </tr>
                    }
                    @if (Parameters.UsePaymentBond && Model.VoucherPosId > 0 && Model.PosInstallmentListVoucher != null && !disableOtherPaymentForOpportunity)
                    {
                        <tr>
                            <td colspan="2">&nbsp;</td>
                        </tr>
                        <tr id="senetodm" class="odmyntm">
                            <td class="alignright">Senetli @(Model.PaymentType == PaymentTypes.SenetleOdeme && Model.SelectedInstallment > 0 ? Model.SelectedInstallment : Parameters.SenetTaksit2) ay Vade Toplam Tutar :</td>
                            <td class="price alignright" width="110">@((Model.PosInstallmentListVoucher.Where(s => s.PosId == Model.VoucherPosId && s.InstallmentNumber == (Model.PaymentType == PaymentTypes.SenetleOdeme && Model.SelectedInstallment > 0 ? Model.SelectedInstallment : Parameters.SenetTaksit2)).FirstOrDefault().TotalInterestPrice).ToString("###,###,##0.00 TL"))</td>
                        </tr>
                    }
                    @if (Parameters.UsePromoCode && !disableOtherPaymentForOpportunity)
                    {
                        <tr id="odmprmtn" class="odmyntm">
                            <td class="alignright">Promosyon Kodunuzu Giriniz :</td>
                            <td class="alignright">
                                @Html.TextBoxFor(m => m.PromoCode, new { @class = "form-control right", @style = "width:70px;height:25px;", maxlength = "15" })
                            </td>
                        </tr>
                    }
                </tfoot>
            </table>
            <div class="clearfix"></div>
        </div>
        <div class="checkOut-section">
            @Html.LabelFor(m => m.OrderNote)
            @Html.TextAreaFor(m => m.OrderNote, new { @class = "form-control", @style = "width:100%;height:75px;resize:none;", @maxlength = "500" })

        </div>
    </div>
    <div class="col-xs-12 col-sm-12 col-md-6 col-lg-5 first last chkpayopts" style="@paymentStyle">
        @*ÖDEME SEÇENEKLERİ*@
        <div class="checkOut-section">
            <h3>Ödeme Tercihim</h3>
            @if (Parameters.UsePartialPayment)
            {
                <div class="checkOut-choice">
                    @Html.RadioButtonFor(model => model.IsTotalPayment, true, new { onclick = "toplamClick(1)", @id = "IsTotalPayment" })
                    <label for="IsTotalPayment">Toplam tutar</label>
                    @Html.RadioButtonFor(model => model.IsTotalPayment, false, new { onclick = "toplamClick(2)", @id = "IsTotalPayment2" })
                    <label for="IsTotalPayment2">Parçalı ödeme</label>
                    @Html.TextBoxFor(model => model.PartialPayment, new { @placeholder = "Tutar Giriniz", @style = "width:99px;visibility:" + (Model.IsTotalPayment == true ? "hidden" : "visible"), @maxlength = "5", @class = "number", @onkeydown = "return KeyDown(event)", @onkeyup = "KeyUp(this)" })
                    <div class="clearfix"></div>
                </div>
                <hr style="margin: 5px 0;" />
            }

            <div class="paymentTypesSection">

                @if (Model.PaymentType == PaymentTypes.KrediKart)
                {
                    @Html.RadioButtonFor(model => model.PaymentType, PaymentTypes.KrediKart, new { @onclick = "changePaymentType(1)", @id = "PaymentTypeKrediKarti", @checked = "checked" });
                }
                else
                {
                    @Html.RadioButtonFor(model => model.SelectedPos, PaymentTypes.KrediKart, new { @onclick = "changePaymentType(1)", @id = "PaymentTypeKrediKarti" });
                }
                <label for="PaymentTypeKrediKarti" class="payment-switch @(Model.PaymentType == PaymentTypes.KrediKart ? "active" : "")">Kredi Kartı ile Ödeme</label><br />

                @if (Model.PaymentType == PaymentTypes.HavaleEft)
                {
                    @Html.RadioButtonFor(model => model.PaymentType, PaymentTypes.HavaleEft, new { @onclick = "changePaymentType(2)", @id = "PaymentTypeHavaleEft", @checked = "checked" });
                }
                else
                {
                    @Html.RadioButtonFor(model => model.SelectedPos, PaymentTypes.HavaleEft, new { @onclick = "changePaymentType(2)", @id = "PaymentTypeHavaleEft" });
                }
                <label for="PaymentTypeHavaleEft" class="payment-switch @(Model.PaymentType == PaymentTypes.HavaleEft ? "active" : "")">Havale / EFT ile Ödeme</label><br />
                @if (!disableOtherPaymentForOpportunity)
                {
                    if (Model.PaymentType == PaymentTypes.KapidaOdeme)
                    {
                    @Html.RadioButtonFor(model => model.PaymentType, PaymentTypes.KapidaOdeme, new { @onclick = "changePaymentType(6)", @id = "PaymentTypeKapidaOdeme", @checked = "checked" });
                    }
                    else
                    {
                    @Html.RadioButtonFor(model => model.SelectedPos, PaymentTypes.KapidaOdeme, new { @onclick = "changePaymentType(6)", @id = "PaymentTypeKapidaOdeme" });
                    }
                    <label for="PaymentTypeKapidaOdeme" class="payment-switch @(Model.PaymentType == PaymentTypes.HavaleEft ? "active" : "")">Kapıda Ödeme</label><br />
                
                    if (Parameters.UsePaymentQuickCredit)
                    {
                        if (Model.PaymentType == PaymentTypes.AnindaKrediOdeme)
                        {
                    @Html.RadioButtonFor(model => model.PaymentType, PaymentTypes.AnindaKrediOdeme, new { @onclick = "changePaymentType(7)", @id = "PaymentTypeAnindaKredi", @checked = "checked" });
                        }
                        else
                        {
                    @Html.RadioButtonFor(model => model.SelectedPos, PaymentTypes.AnindaKrediOdeme, new { @onclick = "changePaymentType(7)", @id = "PaymentTypeAnindaKredi" });
                        }
                    <label for="PaymentTypeAnindaKredi" class="payment-switch @(Model.PaymentType == PaymentTypes.AnindaKrediOdeme ? "active" : "")">Anında Kredi ile Ödeme</label><br />
                    }

                    if (Parameters.UsePaymentBond)
                    {
                        if (Model.PaymentType == PaymentTypes.SenetleOdeme)
                        {
                    @Html.RadioButtonFor(model => model.PaymentType, PaymentTypes.SenetleOdeme, new { @onclick = "changePaymentType(8)", @id = "PaymentTypeSenetleOdeme", @checked = "checked" });
                        }
                        else
                        {
                    @Html.RadioButtonFor(model => model.SelectedPos, PaymentTypes.SenetleOdeme, new { @onclick = "changePaymentType(8)", @id = "PaymentTypeSenetleOdeme" });
                        }
                    <label for="PaymentTypeSenetleOdeme" class="payment-switch @(Model.PaymentType == PaymentTypes.SenetleOdeme ? "active" : "")">Senetle Ödeme</label>
                    }
                }
                else
                {
                    @Html.RadioButtonFor(model => model.SelectedPos, PaymentTypes.KapidaOdeme, new { @id = "PaymentTypeKapidaOdeme", @disabled = "disabled", @onclick = "OnlyCCMTAlert();" });
                    <label class="payment-switch disabled" onclick="OnlyCCMTAlert();">Kapıda Ödeme</label><br />
                    @Html.RadioButtonFor(model => model.SelectedPos, PaymentTypes.AnindaKrediOdeme, new { @id = "PaymentTypeAnindaKredi", @disabled = "disabled", @onclick = "OnlyCCMTAlert();" });
                    <label class="payment-switch disabled" onclick="OnlyCCMTAlert();">Anında Kredi ile Ödeme</label><br />
                    @Html.RadioButtonFor(model => model.SelectedPos, PaymentTypes.SenetleOdeme, new { @id = "PaymentTypeSenetleOdeme", @disabled = "disabled", @onclick = "OnlyCCMTAlert();" });
                    <label class="payment-switch disabled" onclick="OnlyCCMTAlert();">Senetle Ödeme</label>
                }

            </div>
            @*Kredi Kartı ST*@
            <div>
                <div id="pivot-110" class="pivot" style="display: @(Model.PaymentType == PaymentTypes.KrediKart ? "block" : "none")">
                    <h4>Kredi Kartı Bilgileri<span class="right"><a href="#cart-installment-table" class="installmentOptionsLink">Taksit Seçenekleri</a></span></h4>
                    <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 checkout-card-info">
                        <div class="form-group">
                            <select name="selectedPos">
                                @foreach (var Pos in Model.PosList)
                                {
                                    if (Model.SelectedPos == Pos.PosId)
                                    {
                                    <option value="@Pos.PosId" selected="selected">@Pos.CardName</option>
                                    }
                                    else
                                    {
                                    <option value="@Pos.PosId">@Pos.CardName</option>
                                    }
                                }
                            </select>
                        </div>
                        @if (Model.PosInstallmentList.Count > 0)
                        {
                            <div class="form-group">
                                <select name="selectedInstallment">
                                    @foreach (var pi in Model.PosInstallmentList)
                                    {
                                        if (Model.SelectedInstallment == pi.InstallmentNumber)
                                        {
                                        <option value="@pi.InstallmentNumber" selected="selected">@{
                                            if (pi.InstallmentNumber == 1)
                                            {
                                            <text>Tek Çekim (</text> @pi.InterestPrice.ToString("###,###,##0.00") <text>TL)</text>
                                            }
                                            else
                                            {
                                            @pi.InstallmentNumber.ToString() if (pi.AdditionInstallment > 0)
                                                                             {<text>+@pi.AdditionInstallment.ToString()</text>} <text> Taksit (</text> @((pi.InstallmentNumber + pi.AdditionInstallment).ToString()) <text> x </text> @pi.InterestPrice.ToString("###,###,##0.00") <text> TL) = @pi.TotalInterestPrice TL</text>
                                            }
                                        }</option>
                                        }
                                        else
                                        {
                                        <option value="@pi.InstallmentNumber">@{
                                            if (pi.InstallmentNumber == 1)
                                            {
                                            <text>Tek Çekim (</text> @pi.InterestPrice.ToString("###,###,##0.00") <text>TL)</text>
                                            }
                                            else
                                            {
                                            @pi.InstallmentNumber.ToString() if (pi.AdditionInstallment > 0)
                                                                             {<text>+@pi.AdditionInstallment.ToString()</text>} <text> Taksit (</text> @((pi.InstallmentNumber + pi.AdditionInstallment).ToString()) <text> x </text> @pi.InterestPrice.ToString("###,###,##0.00") <text> TL) = @pi.TotalInterestPrice TL</text>
                                            }
                                        }
                                        </option>
                                        }
                                    }
                                </select>
                            </div>
                        }
                        <div class="form-group">
                            @Html.LabelFor(m => m.CardOwnerName)
                            @Html.TextBoxFor(m => m.CardOwnerName, new { @style = "width:92%", @class = "kkisim kart_onyuzde", @autocomplete = "off" })
                        </div>
                        <div class="form-group">
                            @Html.LabelFor(m => m.CardNumber, new { @for = "number1" })
                            <div class="card-number">
                                @Html.TextBoxFor(m => m.CardNumber1, new { @maxlength = "4", @class = "number kkn kkn1 kart_onyuzde", @onkeydown = "return KeyDown(event)", @onkeyup = "KeyUp(this)", @id = "number1", @autocomplete = "off" })
                                <span>-</span>
                            </div>
                            <div class="card-number">
                                @Html.TextBoxFor(m => m.CardNumber2, new { @maxlength = "4", @class = "number kkn kkn2 kart_onyuzde", @onkeydown = "return KeyDown(event)", @onkeyup = "KeyUp(this)", @id = "number2", @autocomplete = "off" })
                                <span>-</span>
                            </div>
                            <div class="card-number">
                                @Html.TextBoxFor(m => m.CardNumber3, new { @maxlength = "4", @class = "number kkn kkn3 kart_onyuzde", @onkeydown = "return KeyDown(event)", @onkeyup = "KeyUp(this)", @id = "number3", @autocomplete = "off" })
                                <span id="number3sep">-</span>
                            </div>
                            <div class="card-number">
                                @Html.TextBoxFor(m => m.CardNumber4, new { @maxlength = "4", @class = "number kkn kkn4 kart_onyuzde", @onkeydown = "return KeyDown(event)", @onkeyup = "KeyUp(this)", @id = "number4", @autocomplete = "off" })
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-5 first last">
                                <div class="col-xs-12 first last">
                                    @Html.LabelFor(m => m.ValidMonth)
                                    @{
                        var months = new List<SelectListItem> {
                                                                            new SelectListItem {Text = "Ay", Value = "0"},
                                                                            new SelectListItem {Text = "01", Value = "1"},
                                                                            new SelectListItem {Text = "02", Value = "2"},
                                                                            new SelectListItem {Text = "03", Value = "3"},
                                                                            new SelectListItem {Text = "04", Value = "4"},
                                                                            new SelectListItem {Text = "05", Value = "5"},
                                                                            new SelectListItem {Text = "06", Value = "6"},
                                                                            new SelectListItem {Text = "07", Value = "7"},
                                                                            new SelectListItem {Text = "08", Value = "8"},
                                                                            new SelectListItem {Text = "09", Value = "9"},
                                                                            new SelectListItem {Text = "10", Value = "10"},
                                                                            new SelectListItem {Text = "11", Value = "11"},
                                                                            new SelectListItem {Text = "12", Value = "12"},
                                                                          };
                        var years = new List<SelectListItem>();
                        years.Add(new SelectListItem { Text = "Yıl", Value = "0" });
                        var yil = Parameters.Now.Year;
                        for (var i = yil; i <= yil + 12; i++)
                        {
                            years.Add(new SelectListItem { Text = i.ToString(), Value = i.ToString() });
                        }
                                    }
                                    @Html.DropDownListFor(m => m.ValidMonth, months, new { @style = "width:55px", @class = "kkay kart_onyuzde" })
                                    / @Html.DropDownListFor(m => m.ValidYear, years, new { @style = "width:75px", @class = "kkyil kart_onyuzde" })
                                </div>
                                <div class="col-xs-12 first last">
                                    @Html.LabelFor(m => m.CVV, new { @id = "cvvlabel" })
                                    @Html.TextBoxFor(m => m.CVV, new { @style = "width:60px", @maxlength = "3", @class = "number kkcvv kart_arkayuzde", @onkeydown = "return KeyDown(event)", @onkeyup = "KeyUp(this)", @autocomplete = "off" })
                                </div>
                                @if (Model.PaymentType == PaymentTypes.KrediKart && Parameters.Use3DPayment && (Model.Type3D == "Var" || Model.Type3D == "Zorunlu" || Model.Type3D == ""))
                                {
                                    <div class="col-xs-12 first last">
                                        <img src="/Images/@Parameters.Theme/checkout-card-3d-ssl.png" />
                                        @Html.HiddenFor(m => m.Type3D)
                                        @if (Model.Type3D == "Var" || Model.Type3D == "")
                                        { 
                                            @Html.CheckBoxFor(m => m.Use3D)
                                        }
                                        else if (Model.Type3D == "Zorunlu")
                                        {
                                            <input type="hidden" value="true" name="Use3D" />
                                            <input type="checkbox" name="Use3DPlaceHolder" disabled="disabled" title="Bu kart ile yapılan alışverişlerde 3D ödeme zorunludur." />
@*Html.CheckBoxFor(m => m.Use3D, new { @disabled = "disabled", @checked = "checked", @title = "Bu kart ile yapılan alışverişlerde 3D ödeme zorunludur." })*@
                                            <script>
                                                $(document).ajaxComplete(function ()
                                                {
                                                    $("input[name=Use3DPlaceHolder]").prop("checked", true);
                                                });
                                            </script>
                                        }
                                        else
                                        {
                                            <input type="hidden" value="false" name="Use3D" />
                                        }
                                        <label for="Use3D" style="display: inline-block;" @{if (Model.Type3D == "Zorunlu")
                                                                                            { <text> title="Bu kart ile yapılan alışverişlerde 3D ödeme zorunludur."</text>}}>
                                            3D Ödeme</label>
                                    </div>
                                }
                                else
                                {
                                    <input type="hidden" value="false" name="Use3D" />
                                }
                            </div>
                            @if (Parameters.CheckOutPageUseCardAnimation)
                            {
                                <div class="col-sm-7 first last kart_onizleme">
                                    <div id="kart_onyuz" class="kart_kalip">
                                        <div id="kart_cvvamex" class="kart_alan">@(Model.CardNumber1)</div>
                                        <div id="kart_num1" class="kart_alan kart_alan_num">@(Model.CardNumber1)</div>
                                        <div id="kart_num2" class="kart_alan kart_alan_num">@(Model.CardNumber2)</div>
                                        <div id="kart_num3" class="kart_alan kart_alan_num">@(Model.CardNumber3)</div>
                                        <div id="kart_num4" class="kart_alan kart_alan_num">@(Model.CardNumber4)</div>
                                        <div id="kart_isim" class="kart_alan">@(Model.CardOwnerName)</div>
                                        <div id="kart_tarih" class="kart_alan">@(Model.ValidMonth > 0 ? (Model.ValidMonth < 10 ? "0" + Model.ValidMonth.ToString() : Model.ValidMonth.ToString()) : "")@{if (Model.ValidMonth > 0 && Model.ValidYear > 0)
                                                                                                                                                                                                         {
                                            <text>/</text>
                                                                                                                                                                                                         }}@(Model.ValidYear > 0 ? Model.ValidYear.ToString().Substring(2, 2) : "")
                                        </div>
                                        <div id="kart_tip" class="@(ctypeclass)">
                                        </div>
                                    </div>
                                    <div id="kart_arkayuz" class="kart_kalip">
                                        <div id="kart_cizgi"></div>
                                        <div id="kart_cvv_bg"></div>
                                        <div id="kart_cvv">@(Model.CVV)</div>
                                    </div>
                                </div>
                            }
                            <div class="clearfix"></div>
                        </div>
                    </div>
                </div>
            </div>
            @*Kredi Kartı FN*@

            @*Havale EFT ST*@
            <div>
                <div class="pivot" id="pivot-120" style="display: @(Model.PaymentType == PaymentTypes.HavaleEft ? "block" : "none")">

                    <select name="SelectedBank">
                        <option value="0">Banka Seçiniz</option>
                        @foreach (var bank in Model.BankList)
                        {
                            if (bank.BankId == Model.SelectedBank)
                            {
                            <option value="@bank.BankId" selected="selected">@bank.BankName</option>
                            }
                            else
                            {
                            <option value="@bank.BankId">@bank.BankName</option>
                            }
                        }
                    </select>
                    @{var bankCounter = 1;
                    }
                    @foreach (var bank in Model.BankList)
                    {
                        var bclass = "bankList";
                        if (Model.SelectedBank == bank.BankId)
                        {
                            bclass = "selectedbnk bankList";
                        }
                        <p class="@bclass" id="bankList@(bank.BankId)">
                            Alıcı Hesabı: @Parameters.BankAccountName<br />
                            <b>@bank.BankName </b>@bank.City / @bank.BranchName Şubesi (@bank.BranchCode)<br />
                            Hesap No: @bank.AccountCode<br />
                            IBAN: @bank.Iban
                        </p>
                        bankCounter++;
                    }
                    <p class="paymentInfoText">Havale / EFT ile yapmış olduğunuz alışverişlerde, alışverişinizin işlem sürecine alınması için ödemenizin yapılmış olması gerekmektedir. Ödemenizi yaparken açıklama kısmına sipariş numaranızı belirtmenizi rica ederiz. </p>
                </div>
            </div>
            @*Havale EFT FN*@

            @*Kapıda Ödeme ST*@

            @if (Parameters.UsePaymentAtDoor)
            {
                <div id="pivot-160" class="pivot" style="display: @(Model.PaymentType == PaymentTypes.KapidaOdeme ? "block" : "none")">
                    <p style="font-weight: bold">
                        Toplam Ödenecek Tutar : @(Model.ContractTotalPrice.ToString("###,###,##0.00 TL"))
                    </p>
                    <p>
                        Kapıda ödeme seçeneği ile yapılan siparişlerde teyid için tarafımızca aranabilirsiniz.
                    </p>
                    <br />
                </div>
            }
@*Kapıda Ödeme FN*@

@*Anında Kredi ST*@
            @if (Parameters.UsePaymentQuickCredit)
            {
                if (Model.PaymentType == PaymentTypes.AnindaKrediOdeme)
                {
                <div id="pivot-170" class="pivot" style="display: @(Model.PaymentType == PaymentTypes.AnindaKrediOdeme ? "block" : "none")">
                    <div class="col-xs-12">
                        <div class="form-group">
                            <div class="col-xs-6 col-sm-6 col-md-6 col-lg-6 first last">
                                @Html.LabelFor(m => m.OtherInstallment)
                                <select name="selectedInstallment" class="form-control">
                                    @foreach (var pi in Model.PosInstallmentList)
                                    {
                                        if (Model.SelectedInstallment == pi.InstallmentNumber)
                                        {
                                        <option value="@pi.InstallmentNumber" selected="selected">@{
                                            if (pi.InstallmentNumber == 1)
                                            {
                                            <text>Tek Çekim (</text> @pi.InterestPrice.ToString("###,###,##0.00") <text>TL)</text>
                                            }
                                            else
                                            {
                                            @pi.InstallmentNumber.ToString() if (pi.AdditionInstallment > 0)
                                                                             {<text>+@pi.AdditionInstallment.ToString()</text>} <text> Taksit (</text> @((pi.InstallmentNumber + pi.AdditionInstallment).ToString()) <text> x </text> @pi.InterestPrice.ToString("###,###,##0.00") <text> TL) = @pi.TotalInterestPrice TL</text>
                                            }
                                        }</option>
                                        }
                                        else
                                        {
                                        <option value="@pi.InstallmentNumber">@{
                                            if (pi.InstallmentNumber == 1)
                                            {
                                            <text>Tek Çekim (</text> @pi.InterestPrice.ToString("###,###,##0.00") <text>TL)</text>
                                            }
                                            else
                                            {
                                            @pi.InstallmentNumber.ToString() if (pi.AdditionInstallment > 0)
                                                                             {<text>+@pi.AdditionInstallment.ToString()</text>} <text> Taksit (</text> @((pi.InstallmentNumber + pi.AdditionInstallment).ToString()) <text> x </text> @pi.InterestPrice.ToString("###,###,##0.00") <text> TL) = @pi.TotalInterestPrice TL</text>
                                            }
                                        }
                                        </option>
                                        }
                                    }
                                </select>
                            </div>
                            <div class="col-xs-6 col-sm-6 col-md-6 col-lg-6 last">
                                @Html.LabelFor(m => m.OtherMonthlyIncoming)
                                @Html.TextBoxFor(m => m.OtherMonthlyIncoming, new { @class = "form-control", @maxlength = "8", @autocomplete = "off" })
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-xs-6 col-sm-6 col-md-6 col-lg-6 first last">
                                @Html.LabelFor(m => m.OtherNameSurname)
                                @Html.TextBoxFor(m => m.OtherNameSurname, new { @class = "form-control", @maxlength = "50", @autocomplete = "off" })
                            </div>
                            <div class="col-xs-6 col-sm-6 col-md-6 col-lg-6 last">
                                @Html.LabelFor(m => m.OtherTcKimlikNo)
                                @Html.TextBoxFor(m => m.OtherTcKimlikNo, new { @class = "form-control", @maxlength = "11", @autocomplete = "off" })
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-xs-6 col-sm-6 col-md-6 col-lg-6 first last">
                                @Html.LabelFor(m => m.OtherFatherName)
                                @Html.TextBoxFor(m => m.OtherFatherName, new { @class = "form-control", @maxlength = "50", @autocomplete = "off" })
                            </div>
                            <div class="col-xs-6 col-sm-6 col-md-6 col-lg-6 last">
                                @Html.LabelFor(m => m.OtherMotherName)
                                @Html.TextBoxFor(m => m.OtherMotherName, new { @class = "form-control", @maxlength = "50", @autocomplete = "off" })
                            </div>
                        </div>
                        @Html.Raw(Parameters.QuickCreditPaymentDescription)
                    </div>
                </div>

                }
            }
@*Anında Kredi FN*@

@*Senetle Ödeme ST*@
            @if (Parameters.UsePaymentBond)
            {
                if (Model.PaymentType == PaymentTypes.SenetleOdeme)
                {
                <div id="pivot-180" class="pivot" style="display: @(Model.PaymentType == PaymentTypes.SenetleOdeme ? "block" : "none")">
                    @{
                    var posListeSN = dbPos.GetList().Where(o => o.PosVoucher == "S");
@*Sadece tek taksit görüncek zaten*@
                    var SenetTaksitCombo = posListeSN.FirstOrDefault();                        
                    }
                    @if (Model.VoucherAvailable == 0)
                    {
                        @Html.HiddenFor(m => m.Guarantor1Id)
                        @Html.HiddenFor(m => m.Guarantor2Id)
                        IList<City> VoucherCities = Parameters.CityList.Where(o => o.VoucherPayment).ToList();
                        @Html.Raw(Model.Message8)
                        <p>
                            Senetli ödeme, şu şehirlerde mevcuttur:<br />
                            @{var vctCounter = 1;}
                            @foreach (var vct in VoucherCities)
                            {
                                @vct.CityName
                                if (vctCounter < VoucherCities.Count())
                                {
                                <text>, </text>
                                }
                                vctCounter++;
                            }
                        </p>
                    }
                    else if (SenetTaksitCombo != null)
                    {
@*Senet Taksit Tablosu*@
@*<script>
                            SelectBank('@SenetTaksitCombo.BankId');
                        </script>*@
                        if (Model.PosInstallmentList.Count > 0)
                        {
                        <div class="col-xs-12">
                            <div class="form-group">
                                <p style="font-size: 13px;"><b>Sipariş vermeden önce lütfen senetli alışveriş sürecini inceleyiniz. İncelemek için <a target="_blank" href="/Icerik/SenetliAlisverisSemasi">tıklayın</a>.</b></p>
                                <br />
                                <label for="selectedInstallment">Taksit Seçiniz:</label>
                                <select name="selectedInstallment" id="selectedInstallment" class="form-control">
                                    <option value="0">Taksit Seçiniz</option>
                                    @foreach (var pi in Model.PosInstallmentList)
                                    {
                                        if (Model.SelectedInstallment == pi.InstallmentNumber)
                                        {
                                        <option value="@pi.InstallmentNumber" selected="selected">@{
                                            if (pi.InstallmentNumber == 1)
                                            {
                                            <text>Tek Çekim (</text> @pi.InterestPrice.ToString("###,###,##0.00") <text>TL)</text>
                                            }
                                            else
                                            {
                                            @pi.InstallmentNumber.ToString() if (pi.AdditionInstallment > 0)
                                                                             {<text>+@pi.AdditionInstallment.ToString()</text>} <text> Taksit (</text> @((pi.InstallmentNumber + pi.AdditionInstallment).ToString()) <text> x </text> @pi.InterestPrice.ToString("###,###,##0.00") <text> TL) = @pi.TotalInterestPrice TL</text>
                                            }
                                        }</option>
                                        }
                                        else
                                        {
                                        <option value="@pi.InstallmentNumber">@{
                                            if (pi.InstallmentNumber == 1)
                                            {
                                            <text>Tek Çekim (</text> @pi.InterestPrice.ToString("###,###,##0.00") <text>TL)</text>
                                            }
                                            else
                                            {
                                            @pi.InstallmentNumber.ToString() if (pi.AdditionInstallment > 0)
                                                                             {<text>+@pi.AdditionInstallment.ToString()</text>} <text> Taksit (</text> @((pi.InstallmentNumber + pi.AdditionInstallment).ToString()) <text> x </text> @pi.InterestPrice.ToString("###,###,##0.00") <text> TL) = @pi.TotalInterestPrice TL</text>
                                            }
                                        }
                                        </option>
                                        }
                                    }
                                </select>
                            </div>
                        </div>
                        }
                        <div class="clearfix"></div>
@*Senet Taksit Seçenekleri Sonu*@
@*Nüfus ve Kimlik Bilgileri*@
                        <div class="col-xs-12 col-md-12">
                            <div class="form-group">
                                <div class="col-xs-12 first last">
                                    <h4 class="info">Aşağıdaki bilgilerin Nüfus Cüzdanı bilgileri ile doldurulması gerekmektedir.</h4>
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-xs-12 col-md-4 first last">
                                    @Html.LabelFor(m => m.Kimlik.FirstName) <span class="required">*</span>
                                    @Html.TextBoxFor(m => m.Kimlik.FirstName, new { @class = "form-control", @maxlength = "50" })
                                </div>
                                <div class="col-xs-12 col-md-4 last">
                                    @Html.LabelFor(m => m.Kimlik.LastName) <span class="required">*</span>
                                    @Html.TextBoxFor(m => m.Kimlik.LastName, new { @class = "form-control", @maxlength = "50" })
                                </div>
                                <div class="col-xs-12 col-md-4 last">
                                    @Html.LabelFor(m => m.Kimlik.N_TCKimlikNo) <span class="required">*</span>
                                    @Html.TextBoxFor(m => m.Kimlik.N_TCKimlikNo, new { @class = "form-control TcKimlikNo", @maxlength = "11" })
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-xs-12 col-md-4 first last">
                                    @Html.LabelFor(m => m.Kimlik.Anne_Ad) <span class="required">*</span>
                                    @Html.TextBoxFor(m => m.Kimlik.Anne_Ad, new { @class = "form-control", @maxlength = "50" })
                                </div>
                                <div class="col-xs-12 col-md-4 last">
                                    @Html.LabelFor(m => m.Kimlik.Baba_Ad) <span class="required">*</span>
                                    @Html.TextBoxFor(m => m.Kimlik.Baba_Ad, new { @class = "form-control", @maxlength = "50" })
                                </div>
                                <div class="col-xs-12 col-md-4 last">
                                    @Html.LabelFor(m => m.Kimlik.Cinsiyet) <span class="required">*</span>
                                    @{var Cinsiyetler = new List<SelectListItem> {
                                                                            new SelectListItem {Text = "Seçiniz", Value = ""},
                                                                            new SelectListItem {Text = "Erkek", Value = "Erkek"},
                                                                            new SelectListItem {Text = "Kadın", Value = "Kadın"}                                          
                                          
                                          };}
                                    @Html.DropDownListFor(m => m.Kimlik.Cinsiyet, Cinsiyetler, new { @class = "form-control", @maxlength = "50" })
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-xs-12 col-md-4 first last">
                                    @Html.LabelFor(m => m.Kimlik.DogumYer) <span class="required">*</span>
                                    @Html.TextBoxFor(m => m.Kimlik.DogumYer, new { @class = "form-control", @maxlength = "20" })
                                </div>
                                <div class="col-xs-12 col-md-8 last">
                                    @Html.LabelFor(m => m.Kimlik.DogumTarihi) <span class="required">*</span>
                                    <div class="clearfix"></div>
                                    <div class="col-xs-3 first last">
                                        @Html.DropDownListFor(m => m.Kimlik.BirthDayNumber, Model.Kimlik.days, new { @style = "width:100%", @class = "form-control" })
                                    </div>
                                    <div class="col-xs-5 first last">
                                        @Html.DropDownListFor(m => m.Kimlik.BirthMonth, Model.Kimlik.months, new { @style = "width:100%", @class = "form-control" })
                                    </div>
                                    <div class="col-xs-4 first last">
                                        @Html.DropDownListFor(m => m.Kimlik.BirthYear, Model.Kimlik.years, new { @style = "width:100%", @class = "form-control" })
                                    </div>
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-xs-12 col-md-12 first last">
                                    @Html.LabelFor(m => m.Kimlik.EvAdres) <span class="required">*</span>
                                    @Html.TextBoxFor(m => m.Kimlik.EvAdres, new { @class = "form-control", @maxlength = "100" })
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-xs-12 col-md-6 first last">
                                    @Html.LabelFor(m => m.Kimlik.EvTel) <span class="required">*</span>
                                    @Html.TextBoxFor(m => m.Kimlik.EvTel, new { @class = "form-control TelefonNo", @maxlength = "50" })
                                </div>
                                <div class="col-xs-12 col-md-6 last">
                                    @Html.LabelFor(m => m.Kimlik.CepTel) <span class="required">*</span>
                                    @Html.TextBoxFor(m => m.Kimlik.CepTel, new { @class = "form-control TelefonNo", @maxlength = "20" })
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-xs-12 col-md-4 first last">
                                    @Html.LabelFor(m => m.Kimlik.IsYeriAdi) <span class="required">*</span>
                                    @Html.TextBoxFor(m => m.Kimlik.IsYeriAdi, new { @class = "form-control", @maxlength = "50" })
                                </div>
                                <div class="col-xs-12 col-md-8 last">
                                    @Html.LabelFor(m => m.Kimlik.IsAdres) <span class="required">*</span>
                                    @Html.TextBoxFor(m => m.Kimlik.IsAdres, new { @class = "form-control", @maxlength = "50" })
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-xs-12 col-md-6 first last">
                                    @Html.LabelFor(m => m.Kimlik.IsTel) <span class="required">*</span>
                                    @Html.TextBoxFor(m => m.Kimlik.IsTel, new { @class = "form-control TelefonNo", @maxlength = "100" })
                                </div>
                                <div class="col-xs-12 col-md-6 last">
                                    @Html.LabelFor(m => m.Kimlik.IsGorev) <span class="required">*</span>
                                    @Html.TextBoxFor(m => m.Kimlik.IsGorev, new { @class = "form-control", @maxlength = "50" })
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-xs-12 col-md-4 first last">
                                    @Html.LabelFor(m => m.Kimlik.AylikGelir) <span class="required">*</span>
                                    @Html.TextBoxFor(m => m.Kimlik.AylikGelir, new { @class = "form-control aylikgelir", @maxlength = "20" })
                                </div>
                                <div class="col-xs-12 col-md-4 last">
                                    @Html.LabelFor(m => m.Kimlik.N_Cuzdan_No) <span class="required">*</span>
                                    @Html.TextBoxFor(m => m.Kimlik.N_Cuzdan_No, new { @class = "form-control n_cuzdanno", @maxlength = "50" })
                                </div>
                                <div class="col-xs-12 col-md-4 last">
                                    @Html.LabelFor(m => m.Kimlik.N_SeriNo) <span class="required">*</span>
                                    @Html.TextBoxFor(m => m.Kimlik.N_SeriNo, new { @class = "form-control n_serino", @maxlength = "50" })
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-xs-12 col-md-4 first last">
                                    @Html.LabelFor(m => m.Kimlik.N_CiltNo) <span class="required">*</span>
                                    @Html.TextBoxFor(m => m.Kimlik.N_CiltNo, new { @class = "form-control n_numerik10", @maxlength = "50" })
                                </div>
                                <div class="col-xs-12 col-md-4 last">
                                    @Html.LabelFor(m => m.Kimlik.N_AileSiraNo) <span class="required">*</span>
                                    @Html.TextBoxFor(m => m.Kimlik.N_AileSiraNo, new { @class = "form-control n_numerik10", @maxlength = "50" })
                                </div>
                                <div class="col-xs-12 col-md-4 last">
                                    @Html.LabelFor(m => m.Kimlik.N_SiraNo) <span class="required">*</span>
                                    @Html.TextBoxFor(m => m.Kimlik.N_SiraNo, new { @class = "form-control n_numerik10", @maxlength = "50" })
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-xs-12 col-md-6 first last">
                                    <label for="N_KutukIl">Bağlı Olduğu İl</label>
                                    <span class="required">*</span>
                                    @Html.TextBoxFor(m => m.Kimlik.N_KutukIl, new { @class = "form-control", @maxlength = "50" })
                                </div>
                                <div class="col-xs-12 col-md-6 last">
                                    <label for="N_Ilce">İlçe</label>
                                    <span class="required">*</span>
                                    @Html.TextBoxFor(m => m.Kimlik.N_Ilce, new { @class = "form-control", @maxlength = "50" })
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-xs-12 col-md-6 first last">
                                    <label for="N_Mahalle">Mahalle</label>
                                    <span class="required">*</span>
                                    @Html.TextBoxFor(m => m.Kimlik.N_Mahalle, new { @class = "form-control", @maxlength = "50" })
                                </div>
                                <div class="col-xs-12 col-md-6 last">
                                    <label for="Kimlik_EvKendineAit">Ev Durumu</label>
                                    @{
                                      var eh = new List<SelectListItem> {
                                                                            new SelectListItem {Text = "Seçiniz", Value = "-1"},
                                                                            new SelectListItem {Text = "Kiracı", Value = "0"},
                                                                            new SelectListItem {Text = "Kendisine Ait", Value = "1"},
                                                                          };
                                    }
                                    @Html.DropDownListFor(m => m.Kimlik.EvKendineAit, eh, new { @class = "form-control" })
                                </div>
                            </div>
                        </div>
@*Nüfus ve Kimlik Bilgileri*@
@*Kefil Bilgileri*@
                        <div class="col-xs-12 col-md-12 first last">
                            <h4 class="info">Kefil bilgilerini doldurmanız zorunlu değildir. Fakat kefil bilgisi vermeniz onay sürenizi kısaltacak ve kolaylaştıracaktır.</h4>
                            <div class="checkOut-guarantor-section col-xs-12 col-sm-12 col-md-6 col-lg-6 first last">
                                <h4>Birinci Kefil</h4>
                                <ul class="checkOut-guarantors-list">
                                    <li>
                                        @Html.DropDownListFor(m => m.Guarantor1Id, new SelectList(Model.GuarantorList, "AccountId", "FullName"), new { onchange = "frmSubmit(0)", @class = "form-control" })
                                    </li>
                                    @if (Model.Guarantor1 != null && Model.Guarantor1.AccountId != 0)
                                    { 
                                        <li>
                                            <a onclick="updateGuarantor(@Model.Guarantor1Id)" class="btn btn-custom1 guarantorEdit" href="#guarantor-update"><span><i class="glyphicon glyphicon-edit"></i>&nbsp;Güncelle</span></a>
                                        </li>
                                    }
                                    <li>
                                        <a onclick="updateGuarantor(0)" class="btn btn-custom1 guarantorEdit" href="#guarantor-update"><span><i class="glyphicon glyphicon-plus"></i>&nbsp;Yeni</span></a>
                                    </li>
                                </ul>
                                <div class="clearfix"></div>
                                @if (Model.Guarantor1 != null && Model.Guarantor1.AccountId != 0)
                                {
                                    <div id="kefil1bilgi" class="checkout-guarantor-content">
                                        @if (Model.Guarantor1 != null && Model.Guarantor1.AccountId != 0)
                                        { 
                                            @(Html.Raw(string.IsNullOrEmpty(Model.Guarantor1.FirstName) ? "" : Model.Guarantor1.FirstName + " "))
                                            @(Html.Raw(string.IsNullOrEmpty(Model.Guarantor1.LastName) ? "" : Model.Guarantor1.LastName + " - "))
                                            @(Html.Raw(string.IsNullOrEmpty(Model.Guarantor1.N_TCKimlikNo) ? "" : Model.Guarantor1.N_TCKimlikNo + "<br />"))
                                            @(Html.Raw(string.IsNullOrEmpty(Model.Guarantor1.EvAdres) ? "" : Model.Guarantor1.EvAdres + " "))
                                            @(Html.Raw(string.IsNullOrEmpty(Model.Guarantor1.N_Ilce) ? "" : Model.Guarantor1.N_Ilce + "/"))
                                            @(Html.Raw(string.IsNullOrEmpty(Model.Guarantor1.N_KutukIl) ? "" : Model.Guarantor1.N_KutukIl + ""))
                                        }
                                    </div>
                                }
                            </div>
                            <div class="checkOut-guarantor-section col-xs-12 col-sm-12 col-md-6 col-lg-6 first last">
                                <h4>İkinci Kefil</h4>
                                <ul class="checkOut-guarantors-list">
                                    <li>
                                        @Html.DropDownListFor(m => m.Guarantor2Id, new SelectList(Model.GuarantorList, "AccountId", "FullName"), new { onchange = "frmSubmit(0)", @class = "form-control" })
                                    </li>
                                    @if (Model.Guarantor2 != null && Model.Guarantor2.AccountId != 0)
                                    { 
                                        <li>
                                            <a onclick="updateGuarantor(@Model.Guarantor2Id)" class="btn btn-custom1 guarantorEdit" href="#guarantor-update"><span><i class="glyphicon glyphicon-edit"></i>&nbsp;Güncelle</span></a>
                                        </li>
                                    }
                                    <li>
                                        <a onclick="updateGuarantor(0)" class="btn btn-custom1 guarantorEdit" href="#guarantor-update"><span><i class="glyphicon glyphicon-plus"></i>&nbsp;Yeni</span></a>
                                    </li>
                                </ul>
                                <div class="clearfix"></div>
                                @if (Model.Guarantor2 != null && Model.Guarantor2.AccountId != 0)
                                {
                                    <div id="kefil2bilgi" class="checkout-guarantor-content">
                                        @if (Model.Guarantor2 != null && Model.Guarantor2.AccountId != 0)
                                        { 
                                            @(Html.Raw(string.IsNullOrEmpty(Model.Guarantor2.FirstName) ? "" : Model.Guarantor2.FirstName + " "))
                                            @(Html.Raw(string.IsNullOrEmpty(Model.Guarantor2.LastName) ? "" : Model.Guarantor2.LastName + " - "))
                                            @(Html.Raw(string.IsNullOrEmpty(Model.Guarantor2.N_TCKimlikNo) ? "" : Model.Guarantor2.N_TCKimlikNo + "<br />"))
                                            @(Html.Raw(string.IsNullOrEmpty(Model.Guarantor2.EvAdres) ? "" : Model.Guarantor2.EvAdres + " "))
                                            @(Html.Raw(string.IsNullOrEmpty(Model.Guarantor2.N_Ilce) ? "" : Model.Guarantor2.N_Ilce + "/"))
                                            @(Html.Raw(string.IsNullOrEmpty(Model.Guarantor2.N_KutukIl) ? "" : Model.Guarantor2.N_KutukIl + ""))
                                        }
                                    </div>
                                }
                            </div>

                        </div>
                        <div class="clearfix"></div>
                        <hr />
@*Kefil Bilgileri*@         
                        @Html.Raw(Parameters.VoucherPaymentDescription)
                    }
                </div>
                }
            }
@*Senetle Ödeme FN*@



            <div class="checkOut-choice">
                <ul>

                    @*          <li><a href="#pivot_130"  onclick="changePaymentType(3)" class="payment-switch @(Model.PaymentType == PaymentTypes.PayPal ? "active" : "")">
                                    PayPal</a></li>
                                <li><a href="#pivot_140" onclick="changePaymentType(4)" class="payment-switch @(Model.PaymentType == PaymentTypes.Mobil ? "active" : "")">
                                    Mobil</a></li>
                                <li><a href="#pivot_150"  onclick="changePaymentType(5)" class="payment-switch @(Model.PaymentType == PaymentTypes.PayU ? "active" : "")">
                                    PayU</a></li>*@
                </ul>
                <div class="clearfix"></div>
            </div>
            <div class="clearfix"></div>
        </div>
        <div class="checkOut-section" id="checkOut-final">
            @if (!string.IsNullOrEmpty(Model.Message1) || !string.IsNullOrEmpty(Model.Message2) || !string.IsNullOrEmpty(Model.Message3) || !string.IsNullOrEmpty(Model.Message4) || !string.IsNullOrEmpty(Model.Message5) || !string.IsNullOrEmpty(Model.Message6) || !string.IsNullOrEmpty(Model.Message7) || !string.IsNullOrEmpty(Model.Message8) || !string.IsNullOrEmpty(Model.Message9) || !string.IsNullOrEmpty(Model.Message10) || !string.IsNullOrEmpty(Model.Message11) || !string.IsNullOrEmpty(Model.Message12))
            {
                <table>
                    <tr>
                        <td style="border: none; width: 100%; padding-bottom: 20px;" colspan="2">
                            <div class="bg-danger checkoutErrors">
                                <p>İşleminiz gerçekleştirilirken aşağıdaki hata(lar) ile karşılaşıldı:</p>
                                <ul>
                                    @(Html.Raw(string.IsNullOrEmpty(Model.Message1) ? "" : "<li>" + Model.Message1 + "</li>"))
                                    @(Html.Raw(string.IsNullOrEmpty(Model.Message2) ? "" : "<li>" + Model.Message2 + "</li>"))
                                    @(Html.Raw(string.IsNullOrEmpty(Model.Message3) ? "" : "<li>" + Model.Message3 + "</li>"))
                                    @(Html.Raw(string.IsNullOrEmpty(Model.Message4) ? "" : "<li>" + Model.Message4 + "</li>"))
                                    @(Html.Raw(string.IsNullOrEmpty(Model.Message5) ? "" : "<li>" + Model.Message5 + "</li>"))
                                    @(Html.Raw(string.IsNullOrEmpty(Model.Message6) ? "" : "<li>" + Model.Message6 + "</li>"))
                                    @(Html.Raw(string.IsNullOrEmpty(Model.Message7) ? "" : "<li>" + Model.Message7 + "</li>"))
                                    @(Html.Raw(string.IsNullOrEmpty(Model.Message8) ? "" : "<li>" + Model.Message8 + "</li>"))
                                    @(Html.Raw(string.IsNullOrEmpty(Model.Message9) ? "" : "<li>" + Model.Message9 + "</li>"))
                                    @(Html.Raw(string.IsNullOrEmpty(Model.Message10) ? "" : "<li>" + Model.Message10 + "</li>"))
                                    @(Html.Raw(string.IsNullOrEmpty(Model.Message11) ? "" : "<li>" + Model.Message11 + "</li>"))
                                    @(Html.Raw(string.IsNullOrEmpty(Model.Message12) ? "" : "<li>" + Model.Message12 + "</li>"))
                                </ul>
                            </div>
                        </td>
                    </tr>
                </table>
            }
            <span class="checkout-confirm">
                <label for="ChkConfirm">
                    <input id="ChkConfirm" type="checkbox" @{if (Model.AgreementChecked == 1)
                                                             {<text>checked="checked"</text>}} /><a class="agreement" onclick="contractview();" href="#dialog-contract">Mesafeli Satış Sözleşmesi</a> ve <a class="agreement" onclick="contractview2();" href="#dialog-contract">Teslimat Koşulları</a>nı onaylıyorum
                </label>
            </span>
            <div style="position: relative; float: left;">
                <div id="Loading2" class="LoadingSmall left">
                    <img src="/Images/@(Parameters.Theme)/loadingSmall.gif" alt="Loading" />
                </div>
            </div>
            <div class="clearfix"></div>
            <button type="button" class="btn btn-custom3 padd backToAddress" onclick="backToAddress()"><i class="glyphicon glyphicon-chevron-left"></i>&nbsp;Geri Dön</button>
            <button type="button" class="btn btn-custom1 padd paymentButton" onclick="frmpost();">Devam Et</button>
        </div>
    </div>
        }
        else
        {    
    <div class="checkOut-inner">
        @*Adres Bilgileri*@
        @if (Model.UserType == 1)
        {
            <div class="checkOut-login col-xs-12 col-sm-12 col-lg-6">
                <h3>Kişisel Bilgiler<div id="LoadingTotalWithCreditCard" class="LoadingSmall right">
                    <img src="/Images/@(Parameters.Theme)/loadingSmall.gif" alt="Loading" />
                </div>
                </h3>
                <h5>Üye olmadan devam et</h5>
                <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 checkout-personel-informations first last">
                    <div class="form-group col-xs-12 last">
                        <div class="col-md-6 first last">
                            @Html.LabelFor(m => m.FirstName)
                            @Html.TextBoxFor(m => m.FirstName, new { @class = "form-control" })
                        </div>
                        <div class="col-md-6 last">
                            @Html.LabelFor(m => m.LastName)
                            @Html.TextBoxFor(m => m.LastName, new { @class = "form-control" })
                        </div>
                    </div>
                    <div class="form-group col-xs-12 last">
                        <div class="col-md-6 first last">
                            @Html.LabelFor(m => m.Email)
                            @Html.TextBoxFor(m => m.Email, new { @class = "form-control" })
                        </div>
                        <div class="col-md-6 last">
                            @Html.LabelFor(m => m.Mobile)
                            @Html.TextBoxFor(m => m.Mobile, new { @class = "form-control" })
                        </div>
                    </div>
                </div>
                <div class="clearfix"></div>
            </div>
            <div class="checkOut-login  col-xs-12 col-sm-12 col-lg-6">
                <h3>Üye Girişi Yap<div id="LoadingTotalWithCreditCard" class="LoadingSmall right">
                    <img src="/Images/@(Parameters.Theme)/loadingSmall.gif" alt="Loading" />
                </div>
                </h3>
                <h5>Hızlı işlem; kayıtlı adreslerin otomatik görünür</h5>
                <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 checkout-login first last">
                    @if (!ViewData.ModelState.IsValid)
                    {
                        <div class="bg-danger first last">
                            @Html.ValidationSummary(true, "Giriş işlemi başarısız oldu. Lütfen bilgileri kontrol ediniz.")
                        </div>
                    }
                    <div class="form-group col-xs-12 last">
                        <div class="col-md-6 first last">
                            <label for="LoginUserName">E-Posta Adresiniz</label>
                            <input type="text" name="LoginUserName" id="LoginUserName" class="form-control" />
                        </div>
                        <div class="col-md-6 last">
                            <label for="LoginPassword">Parolanız</label>
                            <input type="password" name="LoginPassword" id="LoginPassword" class="form-control" />
                        </div>
                    </div>
                    <div class="form-group col-xs-12 last">
                        <div class="col-md-6 last right alignright">
                            <a href="/Account/Login" class="btn btn-custom3">Kaydol&nbsp;<i class="fa fa-sign-in"></i></a>
                            <button type="button" class="btn btn-custom1 cartLoginButton">Giriş Yap&nbsp;<i class="glyphicon glyphicon-chevron-right"></i></button>
                            <br />
                            <label>&nbsp;</label>
                        </div>
                    </div>
                </div>
                <script>
                    $('.cartLoginButton').click(function ()
                    {
                        var LoginPassword = $('#LoginPassword').val();
                        var LoginUserName = $('#LoginUserName').val();
                        $.ajax({
                            url: '/Account/LoginPartial',
                            type: 'POST',
                            data: {
                                Password: LoginPassword,
                                UserName: LoginUserName,
                                returnUrl: 'Cart/CheckOut'
                            },
                            success: function (result)
                            {
                                if (result.url)
                                {
                                    window.location.href = result.url;
                                }
                                else
                                {
                                    alert('Girdiğiniz bilgiler hatalı.');
                                }
                            }
                        });
                    });
                    $('#LoginPassword, #LoginUserName').on("keyup keypress", function (e)
                    {
                        var code = e.keyCode || e.which;
                        if (code == 13)
                        {
                            e.preventDefault();
                            return false;
                        }
                    });
                </script>
                <div class="clearfix"></div>
            </div>
            <div class="clearfix"></div>
            <hr />
        }
        <div class="checkOut-section" style="display: @(Model.SummaryCargo.CartItemCount > 0 ? "block" : "none")">
            <div class="checkOut-address-section col-xs-12 col-sm-12 col-md-12 col-lg-6">
                <h3>Teslimat Adresi Seçiniz</h3>
                <ul class="checkOut-address-list">
                    <li>
                        @Html.DropDownListFor(m => m.CargoAddressId, new SelectList(Model.CargoAddresses, "AddressID", "AddressName"), new { onchange = "frmSubmit(0)", @class = "form-control" })
                    </li>
                    @if (Model.CargoAddress != null && Model.CargoAddress.City != 0)
                    { 
                        <li>
                            <a onclick="updateAddress(@Model.CargoAddressId)" class="btn btn-custom1 addressEdit" href="#address-update"><span><i class="glyphicon glyphicon-edit"></i>&nbsp;Güncelle</span></a>
                        </li>
                    }
                    <li>
                        <a onclick="updateAddress(0)" class="btn btn-custom1 addressEdit" href="#address-update"><span><i class="glyphicon glyphicon-plus"></i>&nbsp;Yeni</span></a>
                    </li>
                </ul>
                <div class="clearfix"></div>
                <div id="teslimAdres" class="checkout-address-content">
                    @if (Model.CargoAddress != null && Model.CargoAddress.City != 0)
                    { 
                        @(Html.Raw(string.IsNullOrEmpty(Model.CargoAddress.Name) ? "" : Model.CargoAddress.Name + "<br /><br />"))
                        @(Html.Raw(string.IsNullOrEmpty(Model.CargoAddress.Address1) ? "" : Model.CargoAddress.Address1 + "<br />"))
                        @(Html.Raw(string.IsNullOrEmpty(Model.CargoAddress.Address2) ? "" : Model.CargoAddress.Address2 + " "))
                        @(Html.Raw(string.IsNullOrEmpty(Model.CargoAddress.PostalCode) ? "" : Model.CargoAddress.PostalCode + "<br />"))
                        @(Html.Raw(string.IsNullOrEmpty(Model.CargoAddress.County) ? "" : Model.CargoAddress.County + " "))
                        @(Html.Raw(string.IsNullOrEmpty(Model.CargoAddress.CityName) ? "" : Model.CargoAddress.CityName + " "))
                        @(Html.Raw(string.IsNullOrEmpty(Model.CargoAddress.CountryName) ? "" : Model.CargoAddress.CountryName))
                    }
                    else
                    {
                        processesHidden = true;
                        <div class="bg-danger">
                            <p>
                                <span class="glyphicon glyphicon-info-sign"></span>&nbsp;Devam edebilmek için lütfen teslimat adresi ekleyin.
                            </p>
                        </div>
                    }
                </div>
            </div>
            <div class="checkOut-address-section col-xs-12 col-sm-12 col-md-12 col-lg-6">
                <h3>Fatura Adresi Seçiniz</h3>
                <ul class="checkOut-address-list">
                    <li>@Html.DropDownListFor(m => m.InvoiceAddressId, new SelectList(Model.CargoAddresses, "AddressID", "AddressName"), new { onchange = "frmSubmit(0)", @class = "form-control" })</li>
                    @if (Model.CargoAddress != null && Model.CargoAddress.City != 0)
                    { 
                        <li><a onclick="updateAddress(@Model.InvoiceAddressId)" class="btn btn-custom1 addressEdit" href="#address-update"><span><i class="glyphicon glyphicon-edit"></i>&nbsp;Güncelle</span></a></li>
                    }
                    <li><a onclick="updateAddress(0)" class="btn btn-custom1 addressEdit" href="#address-update"><span><i class="glyphicon glyphicon-plus"></i>&nbsp;Yeni</span></a></li>
                </ul>
                <div class="clearfix"></div>
                <div id="faturaAdres" class="checkout-address-content">
                    @if (Model.InvoiceAddress != null && Model.CargoAddress.City != 0)
                    {
                        @(Html.Raw(string.IsNullOrEmpty(Model.InvoiceAddress.Name) ? "" : Model.InvoiceAddress.Name + "<br /><br />"))
                        @(Html.Raw(string.IsNullOrEmpty(Model.InvoiceAddress.TaxOffice) ? "" : Model.InvoiceAddress.TaxOffice + " "))
                        @(Html.Raw(string.IsNullOrEmpty(Model.InvoiceAddress.TaxNo) ? "" : Model.InvoiceAddress.TaxNo + "<br />"))                                
                        @(Html.Raw(string.IsNullOrEmpty(Model.InvoiceAddress.Address1) ? "" : Model.InvoiceAddress.Address1 + "<br />"))
                        @(Html.Raw(string.IsNullOrEmpty(Model.InvoiceAddress.Address2) ? "" : Model.InvoiceAddress.Address2 + " "))
                        @(Html.Raw(string.IsNullOrEmpty(Model.InvoiceAddress.PostalCode) ? "" : Model.InvoiceAddress.PostalCode + "<br />"))
                        @(Html.Raw(string.IsNullOrEmpty(Model.InvoiceAddress.County) ? "" : Model.InvoiceAddress.County + " "))
                        @(Html.Raw(string.IsNullOrEmpty(Model.InvoiceAddress.CityName) ? "" : Model.InvoiceAddress.CityName + " "))
                        @(Html.Raw(string.IsNullOrEmpty(Model.InvoiceAddress.CountryName) ? "" : Model.InvoiceAddress.CountryName + "<br />"))
                    }
                    else
                    {
                        processesHidden = true;
                        <div class="bg-danger">
                            <p>
                                <span class="glyphicon glyphicon-info-sign"></span>&nbsp;Devam edebilmek için lütfen fatura adresi ekleyin.
                            </p>
                        </div>
                    }
                    @if (Model.CargoAddress != null && Model.InvoiceAddress != null && Model.CargoAddress.AddressId != Model.InvoiceAddress.AddressId)
                    { 
                        @Html.CheckBoxFor(model => model.CargoWithInvoice, new { onchange = "frmSubmit(0)" });
                        <text>Fatura, ürünlerin yanında gelsin</text>
                    }
                </div>
            </div>
            @*Html.DisplayTextFor(model => model.Message2)*@
            <div class="clearfix"></div>
        </div>
        @*Kargo Seçimi*@
        <div class="checkOut-section checkOut-cargo" style="display: @(Model.SummaryCargo.CartItemCount > 0 ? "block" : "none")">
            <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
                <h3>Kargo Tercihim</h3>
                <ul class="checkout-cargo-select">
                    @foreach (var cargo in Model.CargoList)
                    {
                        if (cargo.OnlyFreeCargoInCity && !Model.FreeCargoInCityAvailable)
                        {
                            continue;
                        }
                        <li>
                            <div class="cargoRadio">
                                @if (Model.SelectedCargoCompanyId == cargo.CargoId)
                                {
                                    @Html.RadioButtonFor(model => model.SelectedCargoCompanyId, @cargo.CargoId, new { @onclick = "CargoSelect(" + cargo.CargoId + ")", @checked = "checked", @id = "cargoSelect" + cargo.CargoId });
                                }
                                else
                                {
                                    @Html.RadioButtonFor(model => model.SelectedCargoCompanyId, @cargo.CargoId, new { @onclick = "CargoSelect(" + cargo.CargoId + ")", @id = "cargoSelect" + cargo.CargoId });
                                }
                            </div>
                            <div class="cargoInfo">
                                <label onclick="CargoSelect(@cargo.CargoId);"@if (Model.SelectedCargoCompanyId == cargo.CargoId)
                                                                             {<text> class="selected-cargo"</text>}>
                                    <img src="@(Parameters.StorageURL)/cargo/@(cargo.CargoId).jpg" alt="@cargo.CargoName" />
                                    @*<span>@cargo.CargoName</span>*@
                                </label>
                            </div>
                        </li>
                    }
                </ul>
            </div>
            <div class="clearfix"></div>
        </div>
        <div class="checkOut-section chksuccess">
            <div class="col-xs-12 col-sm-12 col-md-6 col-lg-6 checkout-cart-minimal">
                <h3>Sepet Özeti</h3>
                <div id="checkoutMinimalContent">
                    @{Html.RenderAction("GetMinimal", "Cart", new { ShowAcrIcrLinks = true });}
                </div>
            </div>
            <div class="col-xs-12 col-sm-12 col-md-6 col-lg-6 checkout-view-top first last">
                <h3>Ödeme Özeti</h3>
                <table class="table-responsive" id="checkOut-view" style="width: 100%;">
                    <thead>
                        <tr>
                            <td class="alignright">Açıklama</td>
                            <td class="alignright">Tutar</td>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td class="alignright">Sepet Tutarı :</td>
                            <td class="price alignright">@Model.SummaryCargo.CartTotalPrice.ToString("###,###,##0.00 TL")</td>
                        </tr>
                        @if (!Model.TransportAvailable)
                        {
                            if (Model.PaymentType == PaymentTypes.KapidaOdeme)
                            {
                                var KargoBedeli = Model.CargoPrice - Parameters.AdditionFeeForPaymentAtDoor;
                            <tr>
                                <td class="alignright">Kargo Bedeli :</td>
                                <td class="price alignright">@KargoBedeli.ToString("###,###,##0.00 TL")</td>
                            </tr>
                            <tr>
                                <td class="alignright">Kapıda Ödeme Bedeli :</td>
                                <td class="price alignright">@Parameters.AdditionFeeForPaymentAtDoor.ToString("###,###,##0.00 TL")</td>
                            </tr>
                            }
                            else
                            {
                            <tr>
                                <td class="alignright">Kargo Bedeli :</td>
                                <td class="price alignright">@Model.CargoPrice.ToString("###,###,##0.00 TL")</td>
                            </tr>
                            }
                        }
                        @if (Model.TransportAvailable)
                        {
                            <tr>
                                <td class="alignright">Nakliye Bedeli :</td>
                                <td class="price alignright">@Model.TransportPrice.ToString("###,###,##0.00 TL")</td>
                            </tr>
                        }
                        @if (Model.InstallationAvailable)
                        {
                            <tr>
                                <td class="alignright">Montaj Bedeli :</td>
                                <td class="price alignright">@Model.InstallationPrice.ToString("###,###,##0.00 TL")</td>
                            </tr>
                        }
                        @if (Model.CargoPrice2 > 0)
                        {
                            <tr>
                                <td class="alignright">Hediye Ürün Kargo Payı :</td>
                                <td class="price alignright">
                                    @Model.CargoPrice2.ToString("###,###,##0.00 TL")
                                </td>
                            </tr>                        
                        }
                        @if (Model.VoucherList.Count > 0)
                        {
                            if (Parameters.UseVoucher)
                            {
                                if (Parameters.UsePartialPayment)
                                { 
                            <tr>
                                <td class="groupheader alignright">Hediye Çeklerim ve Ara Ödemelerim :</td>
                                <td class="groupheader alignright">Tutar :</td>
                            </tr>
                                }
                                else
                                {
                            <tr>
                                <td class="groupheader alignright">Hediye Çeklerim :</td>
                                <td class="groupheader alignright">Tutar :</td>
                            </tr>
                                }
                            }
                            else if (Parameters.UsePartialPayment)
                            {
                            <tr>
                                <td class="groupheader alignright">Ara Ödemelerim :</td>
                                <td class="groupheader alignright">Tutar :</td>
                            </tr>
                            }
                            if (Parameters.UseVoucher || Parameters.UsePartialPayment)
                            {
                                for (int i = 0; i < Model.VoucherList.Count; i++)
                                {
                            <tr>
                                <td class="alignright">
                                    @Html.HiddenFor(model => model.VoucherList[i].VoucherId)
                                    @Html.CheckBoxFor(model => model.VoucherList[i].Selected, new { onchange = "frmSubmit(0)" })
                                    @Model.VoucherList[i].TypeName - @Model.VoucherList[i].CreateDate
                                </td>
                                <td class="price alignright">
                                    @Model.VoucherList[i].Payment.ToString("###,###,##0.00 TL")
                                </td>
                            </tr>
                                }
                            }
                        }
                    </tbody>
                    <tfoot>
                        <tr id="tkstodm" class="odmyntm">
                            <td class="alignright">Taksitli Ödeme Toplam Tutarı :</td>
                            <td class="price alignright">
                                <div style="position: relative; float: right; width: 100%">
                                    <div class="LoadingSmall left" id="LoadingTotal" style="display: none;">
                                        <img alt="Loading" src="/Images/@Parameters.Theme/loadingSmall.gif" />
                                    </div>
                                    @Model.TotalPayment.ToString("###,###,##0.00 TL")
                                </div>
                            </td>
                        </tr>
                        @if (Model.TotalPaymentWithCreditCard > 0)
                        {
                            <tr id="kktckodm" class="odmyntm">
                                <td class="alignright">Kredi Kartı Tek Çekim Toplam Tutarı :</td>
                                <td class="price alignright">
                                    <div style="position: relative; float: right; width: 100%">
                                        <div id="LoadingTotalWithCreditCard" class="LoadingSmall left">
                                            <img src="/Images/@(Parameters.Theme)/loadingSmall.gif" alt="Loading" />
                                        </div>
                                        @Model.TotalPaymentWithCreditCard.ToString("###,###,##0.00 TL")
                                    </div>
                                </td>
                            </tr>
                        }
                        @if (Model.TotalPaymentWithTransfer > 0)
                        {
                            <tr id="hvlftodm" class="odmyntm">
                                <td class="alignright">Havale/EFT ile Ödenirse Toplam Tutar :</td>
                                <td class="price alignright">
                                    <div style="position: relative; float: right; width: 100%">
                                        <div id="LoadingTotalWithTransfer" class="LoadingSmall left">
                                            <img src="/Images/@(Parameters.Theme)/loadingSmall.gif" alt="Loading" />
                                        </div>
                                        @Model.TotalPaymentWithTransfer.ToString("###,###,##0.00 TL")
                                    </div>
                                </td>
                            </tr>
                        }
                        @if (Parameters.UsePaymentBond && Model.VoucherPosId > 0 && Model.PosInstallmentListVoucher != null && !disableOtherPaymentForOpportunity)
                        {
                            <tr>
                                <td colspan="2">&nbsp;</td>
                            </tr>
                            <tr id="senetodm" class="odmyntm">
                                <td class="alignright">Senetli @(Model.PaymentType == PaymentTypes.SenetleOdeme && Model.SelectedInstallment > 0 ? Model.SelectedInstallment : Parameters.SenetTaksit2) ay Vade Toplam Tutar :</td>
                                <td class="price alignright" width="110">@((Model.PosInstallmentListVoucher.Where(s => s.PosId == Model.VoucherPosId && s.InstallmentNumber == (Model.PaymentType == PaymentTypes.SenetleOdeme && Model.SelectedInstallment > 0 ? Model.SelectedInstallment : Parameters.SenetTaksit2)).FirstOrDefault().TotalInterestPrice).ToString("###,###,##0.00 TL"))</td>
                            </tr>
                        }
                        @if (Parameters.UsePromoCode && !disableOtherPaymentForOpportunity)
                        {
                            <tr id="odmprmtn" class="odmyntm">
                                <td class="alignright">Promosyon Kodunuzu Giriniz :</td>
                                <td class="alignright">
                                    @Html.TextBoxFor(m => m.PromoCode, new { @class = "form-control right alignright", @style = "width:116px", maxlength = "15" })
                                </td>
                            </tr>
                        }
                    </tfoot>
                </table>
            </div>
            <div class="clearfix"></div>
        </div>
        <div class="clearfix"></div>
        <div class="checkOut-section chkpayopts">
            <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
                <h3 style="float: left;">Ödeme Tercihim</h3>

                @if (Parameters.UsePartialPayment)
                {
                    <div class="checkOut-choice" style="float: left; border-bottom: none; margin-left: 10px;">
                        @Html.RadioButtonFor(model => model.IsTotalPayment, true, new { onclick = "toplamClick(1)" })
                        <label for="IsTotalPayment">Toplam tutar</label>
                        @Html.RadioButtonFor(model => model.IsTotalPayment, false, new { onclick = "toplamClick(2)" })
                        <label for="IsTotalPayment2">Parçalı ödeme</label>
                        @Html.TextBoxFor(model => model.PartialPayment, new { @placeholder = "Tutar Giriniz", @style = "width:99px; height:25px; float:right; padding: 2px; visibility:" + (Model.IsTotalPayment == true ? "hidden" : "visible"), @maxlength = "5", @class = "number", @onkeydown = "return KeyDown(event)", @onkeyup = "KeyUp(this)" })
                        <div class="clearfix"></div>
                    </div>

                }<div class="clearfix"></div>
                @*Html.DisplayTextFor(model => model.Message3)*@
                <div class="checkOut-choice">
                    <ul>
                        <li style="float: left; margin-right: 5px;">
                            @if (Model.PaymentType == PaymentTypes.KrediKart)
                            {
                                @Html.RadioButtonFor(model => model.PaymentType, PaymentTypes.KrediKart, new { @onclick = "changePaymentType(1)", @checked = "checked" });
                            }
                            else
                            {
                                @Html.RadioButtonFor(model => model.SelectedPos, PaymentTypes.KrediKart, new { @onclick = "changePaymentType(1)" });
                            }
                            <a href="#pivot_110"  onclick="changePaymentType(1)" class="payment-switch @(Model.PaymentType == PaymentTypes.KrediKart ? "active" : "")">
                                <i class="glyphicon glyphicon-credit-card"></i>&nbsp;Kredi Kartı</a> </li>
                        <li style="float: left; margin-right: 5px;">
                            @if (Model.PaymentType == PaymentTypes.HavaleEft)
                            {
                                @Html.RadioButtonFor(model => model.PaymentType, PaymentTypes.HavaleEft, new { @onclick = "changePaymentType(2)", @checked = "checked" });
                            }
                            else
                            {
                                @Html.RadioButtonFor(model => model.SelectedPos, PaymentTypes.HavaleEft, new { @onclick = "changePaymentType(2)" });
                            }
                            <a href="#pivot_120"  onclick="changePaymentType(2)" class="payment-switch @(Model.PaymentType == PaymentTypes.HavaleEft ? "active" : "")">
                                <i class="glyphicon glyphicon-transfer"></i>&nbsp;Havale/Eft</a></li>
                        @if (!disableOtherPaymentForOpportunity)
                        {
                            if (Parameters.UsePaymentAtDoor)
                            {
                            <li style="float: left; margin-right: 5px;">
                                @if (Model.PaymentType == PaymentTypes.KapidaOdeme)
                                {
                                    @Html.RadioButtonFor(model => model.PaymentType, PaymentTypes.KapidaOdeme, new { @onclick = "changePaymentType(6)", @checked = "checked" });
                                }
                                else
                                {
                                    @Html.RadioButtonFor(model => model.SelectedPos, PaymentTypes.KapidaOdeme, new { @onclick = "changePaymentType(6)" });
                                }
                                <a href="#pivot_160"  onclick="changePaymentType(6)" class="payment-switch @(Model.PaymentType == PaymentTypes.KapidaOdeme ? "active" : "")">
                                    <i class="glyphicon glyphicon-home"></i>&nbsp;Kapıda Ödeme&nbsp;&nbsp;(+ @( Parameters.AdditionFeeForPaymentAtDoor.ToString("###,###,##0.00")) TL kapıda ödeme bedeli)</a></li>
                            }
                            if (Parameters.UsePaymentBond)
                            {
                            <li style="float: left; margin-right: 5px;">
                                @if (Model.PaymentType == PaymentTypes.SenetleOdeme)
                                {
                                    @Html.RadioButtonFor(model => model.PaymentType, PaymentTypes.SenetleOdeme, new { @onclick = "changePaymentType(8)", @checked = "checked" });
                                }
                                else
                                {
                                    @Html.RadioButtonFor(model => model.SelectedPos, PaymentTypes.SenetleOdeme, new { @onclick = "changePaymentType(8)" });
                                }
                                <a href="#pivot_180"  onclick="changePaymentType(8)" class="payment-switch @(Model.PaymentType == PaymentTypes.SenetleOdeme ? "active" : "")">
                                    <i class="glyphicon glyphicon-pencil"></i>&nbsp;Senetli Ödeme</a></li>
                            }
                        }
                        else
                        {
                            if (Parameters.UsePaymentAtDoor)
                            {
                            <li style="float: left; margin-right: 5px;">
                                @Html.RadioButtonFor(model => model.SelectedPos, PaymentTypes.KapidaOdeme, new { @disabled = "disabled" });
                                <a href="javascript:void(0)" onclick="OnlyCCMTAlert()" class="payment-switch disabled">
                                    <i class="glyphicon glyphicon-home"></i>&nbsp;Kapıda Ödeme</a></li>
                            }
                            if (Parameters.UsePaymentBond)
                            {
                            <li style="float: left; margin-right: 5px;">
                                @Html.RadioButtonFor(model => model.SelectedPos, PaymentTypes.SenetleOdeme, new { @disabled = "disabled" });
                                <a href="javascript:void(0)" onclick="OnlyCCMTAlert()" class="payment-switch disabled">
                                    <i class="glyphicon glyphicon-pencil"></i>&nbsp;Senetli Ödeme</a></li>
                            }
                        }
                    </ul>
                    <div class="clearfix"></div>
                </div>
            </div>
            <div class="clearfix"></div>
        </div>
        <div class="clearfix"></div>
        <div class="checkOut-section chkpayopts chkpayopts2">
            <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 checkOut-select-pos">
                @*pivot 110*@
                <div id="pivot-110" class="pivot" style="display: @(Model.PaymentType == PaymentTypes.KrediKart ? "block" : "none")">
                    <h3>Lütfen ödeme yapmak istediğiniz kartı seçiniz:</h3>
                    @{
                        var posListe = dbPos.GetList().Where(o => o.PosVoucher == "P" || o.PosVoucher == "" || o.PosVoucher == null);
                        foreach (Pos pos in posListe)
                        {
                            pos.PosInstallment = dbPos.GetInstallmentList(pos.PosId, 1, (Model.SummaryCargo.CartTotalPrice + Model.CargoPrice + Model.TransportPrice + Model.InstallationPrice), 0, 0);
                        }

                        var maxInstallment = posListe.Max(z => z.PosInstallment.Count());
                        if (maxInstallment > Model.MaxInstallmentCount && Model.MaxInstallmentCount > 0)
                        {
                            maxInstallment = Model.MaxInstallmentCount;
                        }
                        var installmentClass = "col-xs-2 col-md-1";
                        var maxInstallmentCustom = 0;
                        switch (maxInstallment)
                        {
                            case 1:
                                installmentClass = "col-xs-9 col-md-9";
                                maxInstallmentCustom = 1;
                                break;
                            case 2:
                            case 3:
                                installmentClass = "col-xs-3 col-md-3";
                                maxInstallmentCustom = 3;
                                break;
                            default:
                                installmentClass = "col-xs-2 col-md-1";
                                maxInstallmentCustom = 9;
                                break;
                        }   
                    }
                    <div class="tInstallment tSelectable">
                        <div class="tRow tRowHead">
                            <div class="tCol tColWide col-xs-2"><span>Kart Seçenekleri</span></div>
                            <div class="tCol tColAddtInst col-xs-2 col-md-1">
                                <span>Artı Taksit</span>
                            </div>
                            @for (var j = 1; j <= maxInstallmentCustom; j++)
                            {
                                if (j == 1)
                                {
                                <div class="tCol @installmentClass"><span>Tek Çekim</span></div>
                                }
                                else if (j == 4)
                                {
                                <div class="tCol @installmentClass"><span>@j Taksit</span></div>
                                <div class="tCol tColMSpace col-xs-2 hidden-md hidden-lg">&nbsp;</div>
                                }
                                else
                                {
                                <div class="tCol @installmentClass"><span>@j Taksit</span></div>
                                }

                            }
                            <div class="clearfix"></div>
                        </div>


                        @foreach (var item in posListe)
                        {
                            if (item.PosInstallment.Count() > 0)
                            {
                                var instCounter = 1;
                            <div class="tRow tRowBody @{if (item.PosId == Model.SelectedPos)
                                                        {<text>tRowSelected</text>}} PosGroup@(item.PosGroup)">
                                <div class="tCol tColWide tColImage col-xs-2">
                                    <img alt="" id="Pos_@(item.PosId)" src="@(Parameters.WebSiteImageUrl)/pos/@(item.PosId).jpg" />
                                </div>
                                <div class="tCol tColAddtInst col-xs-2 col-md-1"><span>@{ @(item.PosInstallment.Count() > 1 && item.PosInstallment.Where(p => p.InstallmentNumber > 1).FirstOrDefault().AdditionInstallment > 0 ? "+" + item.PosInstallment.Where(p => p.InstallmentNumber > 1).FirstOrDefault().AdditionInstallment.ToString() + " Taksit" : "-") }</span></div>
                                @*@if (!string.IsNullOrEmpty(item.Description))
                                                {
                                                    <tr class="installment-warning">
                                                        <td style="text-align: center" class="installment" colspan="4">@Html.Raw(item.Description)</td>
                                                    </tr>
                                                }*@

                                @if (item.PosInstallment.FirstOrDefault().InstallmentNumber > 1)
                                {
                                    for (var i = 1; i < item.PosInstallment.FirstOrDefault().InstallmentNumber; i++)
                                    {
                                    <div class="tCol tColNormal @installmentClass"><span>-</span></div>
                                        instCounter++;
                                    }
                                }
                                @foreach (var pi in item.PosInstallment)
                                {
                                    if (Model.MaxInstallmentCount < pi.InstallmentNumber && Model.MaxInstallmentCount > 0)
                                    {
                                        continue;
                                    }
                                    var whl = true;
                                    while (whl == true)
                                    {
                                        if (pi.InstallmentNumber == instCounter)
                                        {
                                            whl = false;
                                            continue;
                                        }
                                    @Html.Raw("<div class=\"tCol tColNormal " + installmentClass + "\"><span>-</span></div>");

                                                                                                                             instCounter++;
                                    }
                                    var ustSatir = pi.InstallmentNumber + pi.AdditionInstallment > 1 ? pi.InstallmentNumber + pi.AdditionInstallment + " x " + (((pi.InstallmentNumber == 1 ? Model.TotalPaymentWithCreditCard : Model.TotalPayment) * pi.CommissionRate) / pi.TotalInstallment).ToString("###,###,##0.00") : "Tek Çekim";
                                    <div class="tCol tColNormal @{if (pi.InstallmentNumber == Model.SelectedInstallment && item.PosId == Model.SelectedPos)
                                                                  {<text>tColSelected</text>}} @installmentClass@{ if (pi.Bold)
                                                                                                                   {<text> tColBold</text>;
                                                                                                                   }}" onclick="PosAndInstallmentSelect(@item.PosId, @pi.InstallmentNumber)">
                                        <span>@ustSatir<br />
                                            @((pi.InstallmentNumber == 1 ? (Parameters.CreditCardDiscount > 1 ? Model.TotalPaymentWithCreditCard : Model.TotalPayment) : pi.TotalInterestPrice).ToString("###,###,##0.00"))</span>
                                    </div>
                                                                                                                   if (instCounter == 4)
                                                                                                                   {
                                    <div class="tCol tColMSpace col-xs-2 hidden-md hidden-lg">&nbsp;</div>
                                                                                                                   }
                                                                                                                   instCounter++;
                                }
                                @if (instCounter < maxInstallmentCustom + 1)
                                {
                                    for (var i = instCounter; i <= maxInstallmentCustom; i++)
                                    {
                                    @Html.Raw("<div class=\"tCol tColNormal " + installmentClass + "\"><span>-</span></div>");
                                                                                                                             if (instCounter + i == 6)
                                                                                                                             {
                                    <div class="tCol tColMSpace col-xs-2 hidden-md hidden-lg">&nbsp;</div>
                                                                                                                             }
                                    }
                                }
                                <div class="clearfix"></div>
                            </div>
                            }
                        }
                    </div>
                    @if (posListe.Count(o => o.Description != null && o.Description != "") > 0)
                    {
                        <hr />
                        <div class="installmentDescriptions">
                            <table class="table table-bordered">
                                @foreach (var pos in posListe)
                                {
                                    if (!string.IsNullOrEmpty(pos.Description))
                                    {
                                    <tr>
                                        <td>@pos.CardName</td>
                                        <td>@pos.Description</td>
                                    </tr>
                                    }
                                }
                            </table>
                        </div>
                    }
                    <hr />
                    <div class="clearfix"></div>
                    <h3>Lütfen kart bilgilerinizi giriniz</h3>
                    <div class="col-xs-12 col-sm-12 col-md-8 col-lg-7 checkout-card-info" style="display: @(Model.PosInstallmentList.Count > 0 ? "block" : "none");">
                        <div class="form-group">
                            @Html.LabelFor(m => m.CardOwnerName, new { @class = "control-label col-sm-4" })
                            <div class="col-sm-8">
                                @Html.TextBoxFor(m => m.CardOwnerName, new { @autocomplete = "off", @class = "kkisim kart_onyuzde form-control left" })
                            </div>
                        </div>
                        <div class="form-group">
                            @Html.LabelFor(m => m.CardNumber, new { @class = "control-label col-sm-4" })
                            <div class="col-sm-8">
                                <div class="card-number">
                                    @Html.TextBoxFor(m => m.CardNumber1, new { @maxlength = "4", @class = "number kkn kkn1 kart_onyuzde aligncenter", @onkeydown = "return KeyDown(event)", @onkeyup = "KeyUp(this)", @id = "number1", @autocomplete = "off" })
                                    <span>-</span>
                                </div>
                                <div class="card-number">
                                    @Html.TextBoxFor(m => m.CardNumber2, new { @maxlength = "4", @class = "number kkn kkn2 kart_onyuzde aligncenter", @onkeydown = "return KeyDown(event)", @onkeyup = "KeyUp(this)", @id = "number2", @autocomplete = "off" })
                                    <span>-</span>
                                </div>
                                <div class="card-number">
                                    @Html.TextBoxFor(m => m.CardNumber3, new { @maxlength = "4", @class = "number kkn kkn3 kart_onyuzde aligncenter", @onkeydown = "return KeyDown(event)", @onkeyup = "KeyUp(this)", @id = "number3", @autocomplete = "off" })
                                    <span id="number3sep">-</span>
                                </div>
                                <div class="card-number">
                                    @Html.TextBoxFor(m => m.CardNumber4, new { @maxlength = "4", @class = "number kkn kkn4 kart_onyuzde aligncenter", @onkeydown = "return KeyDown(event)", @onkeyup = "KeyUp(this)", @id = "number4", @autocomplete = "off" })
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            @Html.LabelFor(m => m.ValidMonth, new { @class = "control-label col-sm-4" })
                            <div class="col-sm-8">
                                @{
                    var months = new List<SelectListItem> {
                                                                            new SelectListItem {Text = "Ay", Value = "0"},
                                                                            new SelectListItem {Text = "01", Value = "1"},
                                                                            new SelectListItem {Text = "02", Value = "2"},
                                                                            new SelectListItem {Text = "03", Value = "3"},
                                                                            new SelectListItem {Text = "04", Value = "4"},
                                                                            new SelectListItem {Text = "05", Value = "5"},
                                                                            new SelectListItem {Text = "06", Value = "6"},
                                                                            new SelectListItem {Text = "07", Value = "7"},
                                                                            new SelectListItem {Text = "08", Value = "8"},
                                                                            new SelectListItem {Text = "09", Value = "9"},
                                                                            new SelectListItem {Text = "10", Value = "10"},
                                                                            new SelectListItem {Text = "11", Value = "11"},
                                                                            new SelectListItem {Text = "12", Value = "12"},
                                                                          };
                    var years = new List<SelectListItem>();
                    years.Add(new SelectListItem { Text = "Yıl", Value = "0" });
                    var yil = Parameters.Now.Year;
                    for (var i = yil; i <= yil + 12; i++)
                    {
                        years.Add(new SelectListItem { Text = i.ToString(), Value = i.ToString() });
                    }
                                }
                                @Html.DropDownListFor(m => m.ValidMonth, months, new { @style = "width:85px", @class = "kkay kart_onyuzde form-control left aligncenter" })
                                <label class="control-label left">&nbsp;/&nbsp;</label>
                                @Html.DropDownListFor(m => m.ValidYear, years, new { @style = "width:100px", @class = "kkyil kart_onyuzde form-control left aligncenter" })
                            </div>
                        </div>
                        <div class="form-group">
                            @Html.LabelFor(m => m.CVV, new { @class = "control-label col-sm-4" })
                            <div class="col-sm-8">
                                @Html.TextBoxFor(m => m.CVV, new { @style = "width: 85px;", @maxlength = "3", @class = "number kkcvv kart_arkayuzde form-control left aligncenter", @onkeydown = "return KeyDown(event)", @onkeyup = "KeyUp(this)", @autocomplete = "off" })
                                <div style="margin-left: 7px; float: left;@{if (Model.Type3D == "Yok")
                                                                            {<text> display: none;</text>}}">
                                    @Html.HiddenFor(m => m.Type3D)
                                    @if (Model.Type3D == "Var" || Model.Type3D == "")
                                    { 
                                        @Html.CheckBoxFor(m => m.Use3D)
                                    }
                                    else if (Model.Type3D == "Zorunlu")
                                    {
                                        <input type="hidden" value="true" name="Use3D" />
                                        <input type="checkbox" name="Use3DPlaceHolder" disabled="disabled" title="Bu kart ile yapılan alışverişlerde 3D ödeme zorunludur." />
                                        <script>
                                            $(document).ajaxComplete(function ()
                                            {
                                                $("input[name=Use3DPlaceHolder]").prop("checked", true);
                                            });
                                        </script>
                                    }
                                    else
                                    {
                                        <input type="hidden" value="false" name="Use3D" />
                                    }
                                    <label for="Use3D" @{if (Model.Type3D == "Zorunlu")
                                                         { <text> title="Bu kart ile yapılan alışverişlerde 3D ödeme zorunludur."</text>}}>
                                        <img src="/Images/@Parameters.Theme/checkout-card-3d-ssl.png" style="height:35px;" />
                                        3D Ödeme</label>
                                </div>
                            </div>
                        </div>
                    </div>
                    @if (Parameters.CheckOutPageUseCardAnimation)
                    {
                        <div class="col-xs-12 col-sm-12 col-md-4 col-lg-4 last kart_onizleme">
                            <div id="kart_onyuz" class="kart_kalip">
                                <div id="kart_cvvamex" class="kart_alan">@(Model.CardNumber1)</div>
                                <div id="kart_num1" class="kart_alan kart_alan_num">@(Model.CardNumber1)</div>
                                <div id="kart_num2" class="kart_alan kart_alan_num">@(Model.CardNumber2)</div>
                                <div id="kart_num3" class="kart_alan kart_alan_num">@(Model.CardNumber3)</div>
                                <div id="kart_num4" class="kart_alan kart_alan_num">@(Model.CardNumber4)</div>
                                <div id="kart_isim" class="kart_alan">@(Model.CardOwnerName)</div>
                                <div id="kart_tarih" class="kart_alan">@(Model.ValidMonth > 0 ? (Model.ValidMonth < 10 ? "0" + Model.ValidMonth.ToString() : Model.ValidMonth.ToString()) : "")@{if (Model.ValidMonth > 0 && Model.ValidYear > 0)
                                                                                                                                                                                                 {
                                    <text>/</text>
                                                                                                                                                                                                 }}@(Model.ValidYear > 0 ? Model.ValidYear.ToString().Substring(2, 2) : "")
                                </div>
                                <div id="kart_tip" class="@(ctypeclass)">
                                </div>
                            </div>
                            <div id="kart_arkayuz" class="kart_kalip">
                                <div id="kart_cizgi"></div>
                                <div id="kart_cvv_bg"></div>
                                <div id="kart_cvv">@(Model.CVV)</div>
                            </div>
                        </div>
                    }
                    <div class="clearfix"></div>
                </div>

                @*pivot 110-120*@

                <div class="pivot" id="pivot-120" style="display: @(Model.PaymentType == PaymentTypes.HavaleEft ? "block" : "none")">
                    <div class="clearfix"></div>
                    <p class="bg-primary bs-bg">
                        <span class="glyphicon glyphicon-info-sign"></span>
                        Siparişinizin daha hızlı onaylanması için Havale/Eft işlemi para transfer açıklamasına sipariş numaranızı girmeyi unutmayınız.
                    </p>
                    <p style="font-weight: bold">Havale/EFT ile ödenirse toplam tutar : @(Model.ContractTotalPrice.ToString("###,###,##0.00 TL"))</p>
                    @*Html.DisplayTextFor(model => model.Message5)*@
                    <hr />
                    <h4>Banka Hesaplarımız:</h4>
                    @if (!string.IsNullOrEmpty(Parameters.BankAccountName))
                    {
                        <p class="bg-danger bs-bg" style="color: #FF2525 !important;">
                            <span class="glyphicon glyphicon-info-sign"></span>
                            Havale/EFT işlemi sırasında yazılacak hesap adı:
                        <br />
                            <strong>@Parameters.BankAccountName</strong>
                        </p>
                    }
                    @foreach (var bank in Model.BankList)
                    {
                        <div class="accounts_code col-xs-12 col-sm-12 col-md-12 col-lg-12 first last">
                            <div class="bankRadio">
                                @Html.RadioButton("Bank", "", Model.SelectedBank == bank.BankId, new { @onclick = "SelectBank(" + @bank.BankId + ")", @class = "Bank", @id = "Bank" + bank.BankId })
                            </div>
                            <label for="@Html.Raw("Bank" + bank.BankId)">
                                <span class="img">
                                    <img src="/Images/@Parameters.Theme/bank/account/@{@bank.BankId}.png" alt="@bank.BankName" />
                                </span>
                                <span class="acwrap">
                                    <h6><b>@bank.BankName </b>@bank.City / @bank.BranchName Şubesi (@bank.BranchCode)</h6>
                                    <p>Hesap No: @bank.AccountCode</p>
                                    <p>IBAN: @bank.Iban</p>
                                </span>
                            </label>
                        </div>
                    }
                </div>
                <div id="pivot-130" class="pivot" style="display: @(Model.PaymentType == PaymentTypes.PayPal ? "block" : "none")">
                    Paypal not implemented.
                                <br />
                    @*Html.DisplayTextFor(model => model.Message6)*@
                    <br />
                </div>
                <div id="pivot-140" class="pivot" style="display: @(Model.PaymentType == PaymentTypes.Mobil ? "block" : "none")">
                    Mobile payment not implemented.
                                <br />
                    @*Html.DisplayTextFor(model => model.Message7)*@
                    <br />
                </div>
                <div id="pivot-150" class="pivot" style="display: @(Model.PaymentType == PaymentTypes.PayU ? "block" : "none")">
                    PayU payment not implemented.
                                <br />
                    @*Html.DisplayTextFor(model => model.Message8)*@
                    <br />
                </div>
                @if (Parameters.UsePaymentAtDoor)
                {
                    <div id="pivot-160" class="pivot" style="display: @(Model.PaymentType == PaymentTypes.KapidaOdeme ? "block" : "none")">
                        <p style="font-weight: bold">
                            Toplam Ödenecek Tutar : @(Model.ContractTotalPrice.ToString("###,###,##0.00 TL"))
                        </p>
                        <p>
                            Kapıda ödeme seçeneği ile yapılan siparişler için tarafımızca teyid için aranabilirsiniz.
                        </p>
                        <br />
                        @*Html.DisplayTextFor(model => model.Message8)*@
                        <br />
                    </div>
                }
                @if (Parameters.UsePaymentBond)
                {
                    <div id="pivot-180" class="pivot" style="display: @(Model.PaymentType == PaymentTypes.SenetleOdeme ? "block" : "none")">

                        @if (Model.VoucherAvailable == 0)
                        {
                            @Html.HiddenFor(m => m.Guarantor1Id)
                            @Html.HiddenFor(m => m.Guarantor2Id)
                            IList<City> VoucherCities = Parameters.CityList.Where(o => o.VoucherPayment).ToList();
                            @Html.Raw(Model.Message8)
                            <p>
                                Senetli ödeme, şu şehirlerde mevcuttur:<br />
                                @{var vctCounter = 1;}
                                @foreach (var vct in VoucherCities)
                                {
                                    @vct.CityName
                                    if (vctCounter < VoucherCities.Count())
                                    {
                                    <text>, </text>
                                    }
                                    vctCounter++;
                                }
                            </p>
                        }
                        else
                        {
@*Senet Taksit Tablosu*@
                            var posListeSN = dbPos.GetList().Where(o => o.PosVoucher == "S");
                            foreach (Pos pos in posListeSN)
                            {
                                pos.PosInstallment = dbPos.GetInstallmentList(pos.PosId, 1, (Model.SummaryCargo.CartTotalPrice + Model.CargoPrice + Model.TransportPrice + Model.InstallationPrice), 0, 0);
                            }

                            var maxInstallmentSN = posListeSN.Max(z => z.PosInstallment.Count());
                            var installmentClassSN = "col-xs-2";
                            var maxInstallmentCustomSN = 0;
                            switch (maxInstallmentSN)
                            {
                                case 1:
                                    installmentClassSN = "col-xs-9 col-md-9";
                                    maxInstallmentCustomSN = 1;
                                    break;
                                case 2:
                                    installmentClassSN = "col-xs-6";
                                    maxInstallmentCustomSN = 2;
                                    break;
                                case 3:
                                    installmentClassSN = "col-xs-4";
                                    maxInstallmentCustomSN = 3;
                                    break;
                                default:
                                    installmentClassSN = "col-xs-2";
                                    maxInstallmentCustomSN = 6;
                                    break;
                            }
                            <div class="tInstallment tSelectable tVoucher">
                                @foreach (var item in posListeSN)
                                {
                                    if (item.PosInstallment.Count() > 0)
                                    {
                                        var instCounterSN = 1;
                                    <div class="tRow tRowBody @{if (item.PosId == Model.SelectedPos)
                                                                {<text>tRowSelected</text>}} PosGroup@(item.PosGroup)">
                                        @foreach (var pi in item.PosInstallment)
                                        {
                                            var ustSatirSN = pi.InstallmentNumber + pi.AdditionInstallment > 1 ? pi.InstallmentNumber + pi.AdditionInstallment + " ay x " + (((pi.InstallmentNumber == 1 ? Model.TotalPaymentWithCreditCard : Model.TotalPayment) * pi.CommissionRate) / pi.TotalInstallment).ToString("###,###,##0.00") + " TL" : "Tek Ödeme";
                                            <div class="tCol tColNormal @{if (pi.InstallmentNumber == Model.SelectedInstallment && item.PosId == Model.SelectedPos)
                                                                          {<text>tColSelected</text>}} @installmentClassSN@{ if (pi.Bold)
                                                                                                                             {<text> tColBold</text>;
                                                                                                                             }
                                                                                                                             if (instCounterSN == item.PosInstallment.Count() && instCounterSN % maxInstallmentCustomSN != 0)
                                                                                                                             {<text> lastInstallment</text>}}" onclick="PosAndInstallmentSelect(@item.PosId, @pi.InstallmentNumber)">
                                                <span>@ustSatirSN<br />
                                                    @((pi.InstallmentNumber == 1 ? (Parameters.CreditCardDiscount > 1 ? Model.TotalPaymentWithCreditCard : Model.TotalPayment) : pi.TotalInterestPrice).ToString("###,###,##0.00")) TL</span>
                                            </div>
                                                                                                                             if (instCounterSN == 4)
                                                                                                                             {
                                            <div class="tCol tColMSpace col-xs-2 hidden-md hidden-lg">&nbsp;</div>
                                                                                                                             }
                                                                                                                             instCounterSN++;
                                        }
                                        <div class="clearfix"></div>
                                    </div>
                                    }
                                }
                            </div>
                                if (posListeSN.Count(o => o.Description != null && o.Description != "") > 0)
                                {
                            <hr />
                            <div class="installmentDescriptions">
                                <table class="table table-bordered">
                                    @foreach (var pos in posListeSN)
                                    {
                                        if (!string.IsNullOrEmpty(pos.Description))
                                        {
                                        <tr>
                                            <td>@pos.CardName</td>
                                            <td>@pos.Description</td>
                                        </tr>
                                        }
                                    }
                                </table>
                            </div>
                                }
                            <hr />
@*Senet Taksit Seçenekleri Sonu*@
@*Nüfus ve Kimlik Bilgileri*@
                            <div class="col-xs-12 col-md-8">
                                <div class="form-group">
                                    <h4>Aşağıdaki bilgilerin Nüfus Cüzdanı bilgileri ile doldurulması gerekmektedir.</h4>
                                </div>
                                <div class="form-group">
                                    <div class="col-xs-12 col-md-3 col-lg-3 first last">
                                        @Html.LabelFor(m => m.Kimlik.FirstName) <span class="required">*</span>
                                        @Html.TextBoxFor(m => m.Kimlik.FirstName, new { @class = "form-control", @maxlength = "50" })
                                    </div>
                                    <div class="col-xs-12 col-md-3 col-lg-3 last">
                                        @Html.LabelFor(m => m.Kimlik.LastName) <span class="required">*</span>
                                        @Html.TextBoxFor(m => m.Kimlik.LastName, new { @class = "form-control", @maxlength = "50" })
                                    </div>
                                    <div class="col-xs-12 col-md-3 col-lg-3 last">
                                        @Html.LabelFor(m => m.Kimlik.Anne_Ad) <span class="required">*</span>
                                        @Html.TextBoxFor(m => m.Kimlik.Anne_Ad, new { @class = "form-control", @maxlength = "50" })
                                    </div>
                                    <div class="col-xs-12 col-md-3 col-lg-3 last">
                                        @Html.LabelFor(m => m.Kimlik.Baba_Ad) <span class="required">*</span>
                                        @Html.TextBoxFor(m => m.Kimlik.Baba_Ad, new { @class = "form-control", @maxlength = "50" })
                                    </div>
                                </div>
                                <div class="form-group">
                                    <div class="col-xs-12 col-md-3 col-lg-3 first last">
                                        @Html.LabelFor(m => m.Kimlik.N_TCKimlikNo) <span class="required">*</span>
                                        @Html.TextBoxFor(m => m.Kimlik.N_TCKimlikNo, new { @class = "form-control TcKimlikNo", @maxlength = "11" })
                                    </div>
                                    <div class="col-xs-12 col-md-3 col-lg-2 last">
                                        @Html.LabelFor(m => m.Kimlik.Cinsiyet) <span class="required">*</span>
                                        @{var Cinsiyetler = new List<SelectListItem> {
                                                                            new SelectListItem {Text = "Erkek", Value = "Erkek"},
                                                                            new SelectListItem {Text = "Kadın", Value = "Kadın"}                                          
                                          
                                          };}
                                        @Html.DropDownListFor(m => m.Kimlik.Cinsiyet, Cinsiyetler, new { @class = "form-control", @maxlength = "50" })
                                    </div>
                                    <div class="col-xs-12 col-md-4 col-lg-3">
                                        @Html.LabelFor(m => m.Kimlik.DogumYer) <span class="required">*</span>
                                        @Html.TextBoxFor(m => m.Kimlik.DogumYer, new { @class = "form-control", @maxlength = "20" })
                                    </div>
                                    <div class="col-xs-12 col-md-4 col-lg-4 first last">
                                        @Html.LabelFor(m => m.Kimlik.DogumTarihi) <span class="required">*</span>
                                        <div class="clearfix"></div>
                                        <div class="col-xs-3 first last">
                                            @Html.DropDownListFor(m => m.Kimlik.BirthDayNumber, Model.Kimlik.days, new { @style = "width:100%", @class = "form-control" })
                                        </div>
                                        <div class="col-xs-5 first last">
                                            @Html.DropDownListFor(m => m.Kimlik.BirthMonth, Model.Kimlik.months, new { @style = "width:100%", @class = "form-control" })
                                        </div>
                                        <div class="col-xs-4 first last">
                                            @Html.DropDownListFor(m => m.Kimlik.BirthYear, Model.Kimlik.years, new { @style = "width:100%", @class = "form-control" })
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <div class="col-xs-12 col-md-6 col-lg-6 first last">
                                        @Html.LabelFor(m => m.Kimlik.EvAdres) <span class="required">*</span>
                                        @Html.TextBoxFor(m => m.Kimlik.EvAdres, new { @class = "form-control", @maxlength = "100" })
                                    </div>
                                    <div class="col-xs-12 col-md-3 col-lg-3 last">
                                        @Html.LabelFor(m => m.Kimlik.EvTel) <span class="required">*</span>
                                        @Html.TextBoxFor(m => m.Kimlik.EvTel, new { @class = "form-control TelefonNo", @maxlength = "50" })
                                    </div>
                                    <div class="col-xs-12 col-md-3 col-lg-3 last">
                                        @Html.LabelFor(m => m.Kimlik.CepTel) <span class="required">*</span>
                                        @Html.TextBoxFor(m => m.Kimlik.CepTel, new { @class = "form-control TelefonNo", @maxlength = "20" })
                                    </div>
                                </div>
                                <div class="form-group">
                                    <div class="col-xs-12 col-md-3 col-lg-3 first last">
                                        @Html.LabelFor(m => m.Kimlik.IsYeriAdi) <span class="required">*</span>
                                        @Html.TextBoxFor(m => m.Kimlik.IsYeriAdi, new { @class = "form-control", @maxlength = "50" })
                                    </div>
                                    <div class="col-xs-12 col-md-3 col-lg-3 last">
                                        @Html.LabelFor(m => m.Kimlik.IsAdres) <span class="required">*</span>
                                        @Html.TextBoxFor(m => m.Kimlik.IsAdres, new { @class = "form-control", @maxlength = "50" })
                                    </div>
                                    <div class="col-xs-12 col-md-3 col-lg-3 last">
                                        @Html.LabelFor(m => m.Kimlik.IsTel) <span class="required">*</span>
                                        @Html.TextBoxFor(m => m.Kimlik.IsTel, new { @class = "form-control TelefonNo", @maxlength = "100" })
                                    </div>
                                    <div class="col-xs-12 col-md-3 col-lg-3 last">
                                        @Html.LabelFor(m => m.Kimlik.IsGorev) <span class="required">*</span>
                                        @Html.TextBoxFor(m => m.Kimlik.IsGorev, new { @class = "form-control", @maxlength = "50" })
                                    </div>
                                </div>
                                <div class="form-group">
                                    <div class="col-xs-12 col-md-3 col-lg-3 first last">
                                        @Html.LabelFor(m => m.Kimlik.N_SeriNo) <span class="required">*</span>
                                        <div class="clearfix"></div>
                                        <div class="col-xs-4 first last">
                                            @Html.TextBoxFor(m => m.Kimlik.N_SeriNo, new { @class = "form-control n_serino", @maxlength = "3" })
                                        </div>
                                        <div class="col-xs-8 first last">
                                            @Html.TextBoxFor(m => m.Kimlik.N_Cuzdan_No, new { @class = "form-control n_cuzdanno", @maxlength = "6" })
                                        </div>
                                    </div>
                                    <div class="col-xs-12 col-md-3 col-lg-3 last">
                                        @Html.LabelFor(m => m.Kimlik.N_CiltNo) <span class="required">*</span>
                                        @Html.TextBoxFor(m => m.Kimlik.N_CiltNo, new { @class = "form-control n_numerik10", @maxlength = "10" })
                                    </div>
                                    <div class="col-xs-12 col-md-3 col-lg-3 last">
                                        @Html.LabelFor(m => m.Kimlik.N_AileSiraNo) <span class="required">*</span>
                                        @Html.TextBoxFor(m => m.Kimlik.N_AileSiraNo, new { @class = "form-control n_numerik10", @maxlength = "10" })
                                    </div>
                                    <div class="col-xs-12 col-md-3 col-lg-3 last">
                                        @Html.LabelFor(m => m.Kimlik.N_SiraNo) <span class="required">*</span>
                                        @Html.TextBoxFor(m => m.Kimlik.N_SiraNo, new { @class = "form-control n_numerik10", @maxlength = "10" })
                                    </div>
                                </div>
                                <div class="form-group">
                                    <div class="col-xs-12 col-md-3 col-lg-3 first last">
                                        @Html.LabelFor(m => m.Kimlik.N_KutukIl) <span class="required">*</span>
                                        @Html.TextBoxFor(m => m.Kimlik.N_KutukIl, new { @class = "form-control", @maxlength = "50" })
                                    </div>
                                    <div class="col-xs-12 col-md-3 col-lg-3 last">
                                        @Html.LabelFor(m => m.Kimlik.N_Ilce) <span class="required">*</span>
                                        @Html.TextBoxFor(m => m.Kimlik.N_Ilce, new { @class = "form-control", @maxlength = "50" })
                                    </div>
                                    <div class="col-xs-12 col-md-3 col-lg-3 last">
                                        @Html.LabelFor(m => m.Kimlik.N_Mahalle) <span class="required">*</span>
                                        @Html.TextBoxFor(m => m.Kimlik.N_Mahalle, new { @class = "form-control", @maxlength = "50" })
                                    </div>
                                    <div class="col-xs-12 col-md-3 col-lg-3 last">
                                        @Html.LabelFor(m => m.Kimlik.AylikGelir) <span class="required">*</span>
                                        @Html.TextBoxFor(m => m.Kimlik.AylikGelir, new { @class = "form-control aylikgelir", @maxlength = "20" })
                                    </div>
                                </div>
                            </div>
@*Nüfus ve Kimlik Bilgileri*@
@*Kefil Bilgileri*@
                            <div class="col-xs-12 col-md-4 last">
                                <div class="checkOut-guarantor-section col-xs-12 col-sm-12 col-md-12 col-lg-12 first last">
                                    <h3>Birinci Kefil</h3>
                                    <ul class="checkOut-guarantors-list">
                                        <li>
                                            @Html.DropDownListFor(m => m.Guarantor1Id, new SelectList(Model.GuarantorList, "AccountId", "FullName"), new { onchange = "frmSubmit(0)", @class = "form-control" })
                                        </li>
                                        @if (Model.Guarantor1 != null && Model.Guarantor1.AccountId != 0)
                                        { 
                                            <li>
                                                <a onclick="updateGuarantor(@Model.Guarantor1Id)" class="btn btn-custom1 guarantorEdit" href="#guarantor-update"><span><i class="glyphicon glyphicon-edit"></i>&nbsp;Güncelle</span></a>
                                            </li>
                                        }
                                        <li>
                                            <a onclick="updateGuarantor(0)" class="btn btn-custom1 guarantorEdit" href="#guarantor-update"><span><i class="glyphicon glyphicon-plus"></i>&nbsp;Yeni</span></a>
                                        </li>
                                    </ul>
                                    <div class="clearfix"></div>
                                    <div id="kefil1bilgi" class="checkout-guarantor-content">
                                        @if (Model.Guarantor1 != null && Model.Guarantor1.AccountId != 0)
                                        { 
                                            @(Html.Raw(string.IsNullOrEmpty(Model.Guarantor1.FirstName) ? "" : Model.Guarantor1.FirstName + " "))
                                            @(Html.Raw(string.IsNullOrEmpty(Model.Guarantor1.LastName) ? "" : Model.Guarantor1.LastName + " - "))
                                            @(Html.Raw(string.IsNullOrEmpty(Model.Guarantor1.N_TCKimlikNo) ? "" : Model.Guarantor1.N_TCKimlikNo + "<br />"))
                                            @(Html.Raw(string.IsNullOrEmpty(Model.Guarantor1.EvAdres) ? "" : Model.Guarantor1.EvAdres + " "))
                                            @(Html.Raw(string.IsNullOrEmpty(Model.Guarantor1.N_Ilce) ? "" : Model.Guarantor1.N_Ilce + "/"))
                                            @(Html.Raw(string.IsNullOrEmpty(Model.Guarantor1.N_KutukIl) ? "" : Model.Guarantor1.N_KutukIl + ""))
                                        }
                                    </div>
                                </div>
                                <div class="checkOut-guarantor-section col-xs-12 col-sm-12 col-md-12 col-lg-12 first last">
                                    <h3>İkinci Kefil</h3>
                                    <ul class="checkOut-guarantors-list">
                                        <li>
                                            @Html.DropDownListFor(m => m.Guarantor2Id, new SelectList(Model.GuarantorList, "AccountId", "FullName"), new { onchange = "frmSubmit(0)", @class = "form-control" })
                                        </li>
                                        @if (Model.Guarantor2 != null && Model.Guarantor2.AccountId != 0)
                                        { 
                                            <li>
                                                <a onclick="updateGuarantor(@Model.Guarantor2Id)" class="btn btn-custom1 guarantorEdit" href="#guarantor-update"><span><i class="glyphicon glyphicon-edit"></i>&nbsp;Güncelle</span></a>
                                            </li>
                                        }
                                        <li>
                                            <a onclick="updateGuarantor(0)" class="btn btn-custom1 guarantorEdit" href="#guarantor-update"><span><i class="glyphicon glyphicon-plus"></i>&nbsp;Yeni</span></a>
                                        </li>
                                    </ul>
                                    <div class="clearfix"></div>
                                    <div id="kefil2bilgi" class="checkout-guarantor-content">
                                        @if (Model.Guarantor2 != null && Model.Guarantor2.AccountId != 0)
                                        { 
                                            @(Html.Raw(string.IsNullOrEmpty(Model.Guarantor2.FirstName) ? "" : Model.Guarantor2.FirstName + " "))
                                            @(Html.Raw(string.IsNullOrEmpty(Model.Guarantor2.LastName) ? "" : Model.Guarantor2.LastName + " - "))
                                            @(Html.Raw(string.IsNullOrEmpty(Model.Guarantor2.N_TCKimlikNo) ? "" : Model.Guarantor2.N_TCKimlikNo + "<br />"))
                                            @(Html.Raw(string.IsNullOrEmpty(Model.Guarantor2.EvAdres) ? "" : Model.Guarantor2.EvAdres + " "))
                                            @(Html.Raw(string.IsNullOrEmpty(Model.Guarantor2.N_Ilce) ? "" : Model.Guarantor2.N_Ilce + "/"))
                                            @(Html.Raw(string.IsNullOrEmpty(Model.Guarantor2.N_KutukIl) ? "" : Model.Guarantor2.N_KutukIl + ""))
                                        }
                                    </div>
                                </div>

                            </div>
                            <div class="clearfix"></div>
                            <hr />
@*Kefil Bilgileri*@         
                            @Html.Raw(Parameters.VoucherPaymentDescription)
                        }
                    </div>
                }
                <div class="clearfix"></div>

            </div>

            <div class="clearfix"></div>
        </div>
        <div class="checkOut-section" id="checkOut-final">
            <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 first last">
                <table style="width: 100%;">
                    <tbody>
                        @if (!string.IsNullOrEmpty(Model.Message1) || !string.IsNullOrEmpty(Model.Message2) || !string.IsNullOrEmpty(Model.Message3) || !string.IsNullOrEmpty(Model.Message4) || !string.IsNullOrEmpty(Model.Message5) || !string.IsNullOrEmpty(Model.Message6) || !string.IsNullOrEmpty(Model.Message7) || !string.IsNullOrEmpty(Model.Message8) || !string.IsNullOrEmpty(Model.Message9) || !string.IsNullOrEmpty(Model.Message10) || !string.IsNullOrEmpty(Model.Message11) || !string.IsNullOrEmpty(Model.Message12))
                        {
                            <tr>
                                <td style="border: none; width: 100%; padding-bottom: 20px;" colspan="2">
                                    <div class="bg-danger checkoutErrors">
                                        <p>İşleminiz gerçekleştirilirken aşağıdaki hata(lar) ile karşılaşıldı:</p>
                                        <ul>
                                            @(Html.Raw(string.IsNullOrEmpty(Model.Message1) ? "" : "<li>" + Model.Message1 + "</li>"))
                                            @(Html.Raw(string.IsNullOrEmpty(Model.Message2) ? "" : "<li>" + Model.Message2 + "</li>"))
                                            @(Html.Raw(string.IsNullOrEmpty(Model.Message3) ? "" : "<li>" + Model.Message3 + "</li>"))
                                            @(Html.Raw(string.IsNullOrEmpty(Model.Message4) ? "" : "<li>" + Model.Message4 + "</li>"))
                                            @(Html.Raw(string.IsNullOrEmpty(Model.Message5) ? "" : "<li>" + Model.Message5 + "</li>"))
                                            @(Html.Raw(string.IsNullOrEmpty(Model.Message6) ? "" : "<li>" + Model.Message6 + "</li>"))
                                            @(Html.Raw(string.IsNullOrEmpty(Model.Message7) ? "" : "<li>" + Model.Message7 + "</li>"))
                                            @(Html.Raw(string.IsNullOrEmpty(Model.Message8) ? "" : "<li>" + Model.Message8 + "</li>"))
                                            @(Html.Raw(string.IsNullOrEmpty(Model.Message9) ? "" : "<li>" + Model.Message9 + "</li>"))
                                            @(Html.Raw(string.IsNullOrEmpty(Model.Message10) ? "" : "<li>" + Model.Message10 + "</li>"))
                                            @(Html.Raw(string.IsNullOrEmpty(Model.Message11) ? "" : "<li>" + Model.Message11 + "</li>"))
                                            @(Html.Raw(string.IsNullOrEmpty(Model.Message12) ? "" : "<li>" + Model.Message12 + "</li>"))
                                        </ul>
                                    </div>
                                </td>
                            </tr>
                        }
                        <tr>
                            <td style="border: none; width: 100%; padding-right: 20px;" class="alignright">
                                <span class="checkout-confirm">
                                    <input id="ChkConfirm" type="checkbox" @{if (Model.AgreementChecked == 1)
                                                                             {<text>checked="checked"</text>}} />
                                    <label for="ChkConfirm"><a class="agreement" onclick="contractview();" href="#dialog-contract">Mesafeli Satış Sözleşmesi</a> ve <a class="agreement" onclick="contractview2();" href="#dialog-contract">Teslimat Koşulları</a>nı onaylıyorum </label>
                                </span>
                                <div style="position: relative; float: left;">
                                    <div id="Loading2" class="LoadingSmall left">
                                        <img src="/Images/@(Parameters.Theme)/loadingSmall.gif" alt="Loading" />
                                    </div>
                                </div>
                            </td>
                            <td style="border: none" class="alignright">
                                <a class="btn btn-custom1 paymentButton" onclick="frmpost()">
                                    <span>Devam Et&nbsp;<i class="glyphicon glyphicon-chevron-right"></i></span>
                                </a>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>

            <div class="clearfix"></div>
        </div>
    </div>
        }
    <div style="display: none;">
        <div id="address-update" title="Adres"></div>
        <div id="guarantor-update" title="Kefil"></div>
        <div id="dialog-form" title="Adres"></div>
        <div style="margin: 10px 0;" id="cart-installment-table">
            @{
        var posListe2 = dbPos.GetList().Where(o => o.PosVoucher == "P" || o.PosVoucher == "" || o.PosVoucher == null);
        foreach (Pos pos in posListe2)
        {
            pos.PosInstallment = dbPos.GetInstallmentList(pos.PosId, 1, (Model.SummaryCargo.CartTotalPrice + Model.CargoPrice + Model.TransportPrice + Model.InstallationPrice), 0, 0);
        }

        var maxInstallment2 = posListe2.Max(z => z.PosInstallment.Count());
        if (maxInstallment2 > Model.MaxInstallmentCount && Model.MaxInstallmentCount > 0)
        {
            maxInstallment2 = Model.MaxInstallmentCount;
        }
        var installmentClass2 = "col-xs-2 col-md-1";
        var maxInstallmentCustom2 = 0;
        switch (maxInstallment2)
        {
            case 1:
                installmentClass2 = "col-xs-9 col-md-9";
                maxInstallmentCustom2 = 1;
                break;
            case 2:
            case 3:
                installmentClass2 = "col-xs-3 col-md-3";
                maxInstallmentCustom2 = 3;
                break;
            default:
                installmentClass2 = "col-xs-2 col-md-1";
                maxInstallmentCustom2 = 9;
                break;
        }   
            }
            <div class="tNotSelectable">
                <div class="tRow tRowHead">
                    <div class="tCol tColWide col-xs-2"><span>Kart Seçenekleri</span></div>
                    <div class="tCol tColAddtInst col-xs-2 col-md-1">
                        <span>Artı Taksit</span>
                    </div>
                    @for (var j = 1; j <= maxInstallmentCustom2; j++)
                    {
                        if (j == 1)
                        {
                        <div class="tCol @installmentClass2"><span>Tek Çekim</span></div>
                        }
                        else if (j == 4)
                        {
                        <div class="tCol @installmentClass2"><span>@j Taksit</span></div>
                        <div class="tCol tColMSpace col-xs-2 hidden-md hidden-lg">&nbsp;</div>
                        }
                        else
                        {
                        <div class="tCol @installmentClass2"><span>@j Taksit</span></div>
                        }

                    }
                    <div class="clearfix"></div>
                </div>


                @foreach (var item in posListe2)
                {
                    if (item.PosInstallment.Count() > 0)
                    {
                        var instCounter = 1;
                    <div class="tRow tRowBody  PosGroup@(item.PosGroup)">
                        <div class="tCol tColWide tColImage col-xs-2">
                            <img alt="" id="Pos_@(item.PosId)" src="@(Parameters.WebSiteImageUrl)/pos/@(item.PosId).jpg" />
                        </div>
                        <div class="tCol tColAddtInst col-xs-2 col-md-1"><span>@{ @(item.PosInstallment.Count() > 1 && item.PosInstallment.Where(p => p.InstallmentNumber > 1).FirstOrDefault().AdditionInstallment > 0 ? "+" + item.PosInstallment.Where(p => p.InstallmentNumber > 1).FirstOrDefault().AdditionInstallment.ToString() + " Taksit" : "-") }</span></div>
                        @*@if (!string.IsNullOrEmpty(item.Description))
                                                {
                                                    <tr class="installment-warning">
                                                        <td style="text-align: center" class="installment" colspan="4">@Html.Raw(item.Description)</td>
                                                    </tr>
                                                }*@
                        @if (item.PosInstallment.FirstOrDefault().InstallmentNumber > 1)
                        {
                            for (var i = 1; i < item.PosInstallment.FirstOrDefault().InstallmentNumber; i++)
                            {
                            <div class="tCol tColNormal @installmentClass2"><span>-</span></div>
                                instCounter++;
                            }
                        }

                        @foreach (var pi in item.PosInstallment)
                        {
                            if (Model.MaxInstallmentCount < pi.InstallmentNumber && Model.MaxInstallmentCount > 0)
                            {
                                continue;
                            }
                            var whl = true;
                            while (whl == true)
                            {
                                if (pi.InstallmentNumber == instCounter)
                                {
                                    whl = false;
                                    continue;
                                }
                            <div class="tCol tColNormal @installmentClass2"><span>-</span></div>
                                instCounter++;
                            }
                            var ustSatir = pi.InstallmentNumber + pi.AdditionInstallment > 1 ? pi.InstallmentNumber + pi.AdditionInstallment + " x " + (((pi.InstallmentNumber == 1 ? Model.TotalPaymentWithCreditCard : Model.TotalPayment) * pi.CommissionRate) / pi.TotalInstallment).ToString("###,###,##0.00") : "Tek Çekim";
                            <div class="tCol tColNormal @installmentClass2@{ if (pi.Bold)
                                                                             {<text> tColBold</text>;
                                                                             }}">
                                <span>@ustSatir<br />
                                    @((pi.InstallmentNumber == 1 ? (Parameters.CreditCardDiscount > 1 ? Model.TotalPaymentWithCreditCard : Model.TotalPayment) : pi.TotalInterestPrice).ToString("###,###,##0.00"))</span>
                            </div>
                                                                             if (instCounter == 4)
                                                                             {
                            <div class="tCol tColMSpace col-xs-2 hidden-md hidden-lg">&nbsp;</div>
                                                                             }
                                                                             instCounter++;
                        }
                        @if (instCounter < maxInstallmentCustom2 + 1)
                        {
                            for (var i = instCounter; i <= maxInstallmentCustom2; i++)
                            {
                            <div class="tCol tColNormal zz @installmentClass2"><span>-</span></div>
                                if (instCounter + i == 6)
                                {
                            <div class="tCol tColMSpace col-xs-2 hidden-md hidden-lg">&nbsp;</div>
                                }
                            }
                        }
                        <div class="clearfix"></div>
                    </div>
                    }
                }
            </div>

            @if (posListe2.Count(o => o.Description != null && o.Description != "") > 0)
            {
                <hr />
                <div class="installmentDescriptions">
                    <table class="table table-bordered">
                        @foreach (var pos in posListe2)
                        {
                            if (!string.IsNullOrEmpty(pos.Description))
                            {
                            <tr>
                                <td>@pos.CardName</td>
                                <td>@pos.Description</td>
                            </tr>
                            }
                        }
                    </table>
                </div>
            }
            <div class="clearfix"></div>
        </div>
    </div>
    <script type="text/javascript">
        @*var processesHidden = false;
        @if (processesHidden)
        {
            <text>processesHidden = true;</text>
        }*@


        /*Kredi Kartı Önizleme*/
        if ($(window).width() > 767)
        {
            $('.kart_onyuzde').focus(function ()
            {
                kartonyuzgoster();
                $('.kart_alan').removeClass('focused');
                if ($(this).hasClass('kkn1'))
                {
                    $('#kart_num1').addClass('focused');
                }
                else if ($(this).hasClass('kkn2'))
                {
                    $('#kart_num2').addClass('focused');
                }
                else if ($(this).hasClass('kkn3'))
                {
                    $('#kart_num3').addClass('focused');
                }
                else if ($(this).hasClass('kkn4'))
                {
                    $('#kart_num4').addClass('focused');
                }
                else if ($(this).hasClass('kkisim'))
                {
                    $('#kart_isim').addClass('focused');
                }
                else if ($(this).hasClass('kkay') || $(this).hasClass('kkyil'))
                {
                    $('#kart_tarih').addClass('focused');
                }
                else if ($(this).hasClass('kkcvv'))
                {
                    $('#kart_cvvamex').addClass('focused');
                }
            });
            $('.kart_arkayuzde').live('focus', function ()
            {
                kartarkayuzgoster();
            });
            $('.kart_arkayuzde').live('focusout', function ()
            {
                kartonyuzgoster();
            });
            $('.kkn1').keyup(function ()
            {
                $('#CVV').removeClass('kart_arkayuzde');
                $('#CVV').removeClass('kart_onyuzde');
                $('#kart_num1').html($(this).val());
                var firstChar = $(this).val().substring(0, 1);
                var secondChar = $(this).val().substring(1, 1);
                if (firstChar == '4')
                {
                    $('#kart_tip').attr('class', 'visa');
                    $('#CVV').removeClass('kart_onyuzde');
                    $('#CVV').addClass('kart_arkayuzde');
                    amexiptal();
                }
                else if (firstChar == '5')
                {
                    $('#kart_tip').attr('class', 'mastercard');
                    $('#CVV').removeClass('kart_onyuzde');
                    $('#CVV').addClass('kart_arkayuzde');
                    amexiptal();
                }
                else if (firstChar == '3')
                {
                    $('#kart_tip').attr('class', 'amex');
                    $('#CVV').removeClass('kart_arkayuzde');
                    $('#CVV').addClass('kart_onyuzde');
                    amexhazirla();
                }
                else
                {
                    $('#kart_tip').attr('class', '');
                }
                $('#kart_num1').addClass('focused')
            });
            $('.kart_onyuzde').keyup(function ()
            {
                $('.kart_alan').removeClass('focused');
                if ($(this).hasClass('kkn2'))
                {
                    $('#kart_num2').html($(this).val()).addClass('focused');
                }
                else if ($(this).hasClass('kkn3'))
                {
                    $('#kart_num3').html($(this).val()).addClass('focused');
                }
                else if ($(this).hasClass('kkn4'))
                {
                    $('#kart_num4').html($(this).val()).addClass('focused');
                }
                else if ($(this).hasClass('kkisim'))
                {
                    $('#kart_isim').html($(this).val()).addClass('focused');
                }
            });
            $('.kkay').change(function ()
            {
                tarihgoster();
            });
            $('.kkyil').change(function ()
            {
                tarihgoster();
            });
            $('.kkcvv ').keyup(function ()
            {
                $('.kart_alan').removeClass('focused');
                if ($(this).hasClass('kkcvv'))
                {
                    $('#kart_cvv').html($(this).val()).addClass('focused');
                    $('#kart_cvvamex').html($(this).val()).addClass('focused');
                }
            });

            function amexhazirla()
            {
                $('input#number1').attr('maxlength', '4');
                $('input#number2').attr('maxlength', '6');
                $('input#number3').attr('maxlength', '5');
                //$('input#number4').attr('maxlength', '0');
                $('input#number4').hide();
                $('#checkoutForm .chkpayopts .checkout-card-info input.number.kkn').css('width', '29%');
                $('#number3sep').css('visibility', 'hidden');

                $('#cvvlabel').html('Güvenlik Kodu (CID)');
                $('input#CVV').attr('maxlength', '4');

                $('#kart_cvvamex').show();
                $('#kart_cvv').hide();

                $('.kart_onizleme #kart_onyuz.kart_kalip #kart_num1').css({ 'left': '15px', 'width': '45px' });
                $('.kart_onizleme #kart_onyuz.kart_kalip #kart_num2').css({ 'left': '75px', 'width': '65px' });
                $('.kart_onizleme #kart_onyuz.kart_kalip #kart_num3').css({ 'left': '155px', 'width': '55px' });
                $('.kart_onizleme #kart_onyuz.kart_kalip #kart_num4').css({ 'display': 'none', 'left': '160px', 'width': '45px' });
            }
            function amexiptal()
            {
                $('input#number1').attr('maxlength', '4');
                $('input#number2').attr('maxlength', '4');
                $('input#number3').attr('maxlength', '4');
                //$('input#number4').attr('maxlength', '4');
                $('input#number4').show();
                $('#checkoutForm .chkpayopts .checkout-card-info input.number.kkn').css('width', '20%');
                $('#number3sep').css('visibility', 'visible');

                $('#cvvlabel').html('Güvenlik Kodu (CVV)');
                $('input#CVV').attr('maxlength', '3');

                $('#kart_cvv').show();
                $('#kart_cvvamex').hide();

                $('.kart_onizleme #kart_onyuz.kart_kalip #kart_num1').css({ 'left': '10px', 'width': '45px' });
                $('.kart_onizleme #kart_onyuz.kart_kalip #kart_num2').css({ 'left': '60px', 'width': '45px' });
                $('.kart_onizleme #kart_onyuz.kart_kalip #kart_num3').css({ 'left': '110px', 'width': '45px' });
                $('.kart_onizleme #kart_onyuz.kart_kalip #kart_num4').css({ 'display': 'block', 'left': '160px', 'width': '45px' });


            }

            function tarihgoster()
            {
                var tarihay = $('.kkay').val();
                if (tarihay < 10)
                {
                    tarihay = "0" + tarihay;
                }
                var tarihyil = $('.kkyil').val().substr(2, 2);
                $('#kart_tarih').html(tarihay + ' / ' + tarihyil);
            }
            function kartonyuzgoster()
            {
                $('#kart_arkayuz').animate({ 'width': '0px' }, 750, function ()
                {
                    $('#kart_arkayuz').hide();
                    $('#kart_onyuz').animate({ 'width': '100%' }).show();
                });
            }
            function kartarkayuzgoster()
            {
                $('#kart_onyuz').animate({ 'width': '0px' }, 750, function ()
                {
                    $('#kart_onyuz').hide();
                    $('#kart_arkayuz').animate({ 'width': '100%' }).show();
                });
            }
        }
        /*Kredi Kartı Önizleme*/


        $('.LoadingSmall').hide();
        paymentChangeColors($('input[name=PaymentType]:checked').val());

        $('a.payment-switch').click(function ()
        {
            var qsId = $(this).attr('href').split("_")[1];

            $('.pivot').hide();
            $('#pivot-' + qsId).show();
            $('#PaymentType').val(qsId);

            $(".payment-switch").removeClass("active");
            $(this).addClass("active");

            return false;
        });

        $('select[name=selectedInstallment]').change(function ()
        {
            InstallmentSelect($(this).val());
        });
        $('select[name=selectedPos]').change(function ()
        {
            PosSelect($(this).val());
        });

        function InstallmentSelect(id)
        {
            $('#SelectedInstallment').val(id);
            $('.paymentButton').css("visibility", "hidden");
            $('#frmRefresh').submit();
        }
        function PosSelect(id)
        {
            $('#SelectedPos').val(id);
            $('.paymentButton').css("visibility", "hidden");
            $('#frmRefresh').submit();
        }
        function PosAndInstallmentSelect(posId, instId)
        {
            $('#SelectedPos').val(posId);
            $('#SelectedInstallment').val(instId);
            //$('.paymentButton').css("visibility", "hidden");
            $('#frmRefresh').submit();
        }
        function continueToPayment()
        {
            var PersonalInfoNeeded = false;
            var ProcesHdn = false;
            @if (processesHidden)
            {
                <text>ProcesHdn = true;</text>
            }
    @if (Model.UserType == 1)
    {
        <text>PersonalInfoNeeded = true;</text>
    }

            if (PersonalInfoNeeded)
            {
                if ($('#FirstName').val() == '' || $('#LastName').val() == '' || $('#Email').val() == '')
                {
                    alert('Kişisel bilgilerinizi giriniz.');
                    return false;
                }
            }
            if (ProcesHdn)
            {
                alert('Adres seçimi yapınız.');
                return false;
            }
            $('#AddressCompleted').val(1);
            $('#frmRefresh').submit();
        }
        function backToAddress()
        {
            $('#AddressCompleted').val(0);
            $('#frmRefresh').submit();
            $('html:not(:animated)').animate({ scrollTop: 0 }, 'slow');
        }

        $('#ChkConfirm').change(function ()
        {
            if ($(this).is(":checked"))
            {
                $('#AgreementChecked').val('1');
            }
            else
            {
                $('#AgreementChecked').val('0');
            }
        });




        $('.tSelectable .tRow .tCol.tColNormal').click(function ()
        {
            if ($(this).html() != '<span>-</span>')
            {
                $('.tSelectable .tRow .tCol.tColNormal').removeClass('tColSelected');
                $('.tSelectable .tRow').removeClass('tRowSelected');
                $(this).addClass('tColSelected');
                $(this).parent().addClass('tRowSelected');
            }
            else
            {
                alert('Geçersiz taksit seçimi.');
            }
        });
        function CargoSelect(id)
        {
            $('#SelectedCargoCompanyId').val(id);
            $('.paymentButton').css("visibility", "hidden");
            $('#frmRefresh').submit();
        }
        $('select[name=SelectedBank]').change(function ()
        {
            SelectBank($(this).val());
        });


        function SelectBank(id)
        {
            $('#SelectedBank').val(id);
            $('p.bankList').each(function ()
            {
                if ($(this).attr("id") == "bankList" + id)
                {
                    $(this).addClass("selectedbnk");
                }
                else
                {
                    $(this).removeClass("selectedbnk");
                }
            });
        }
        function frmpost()
        {
            if ($('#PaymentType').val() == 'SenetleOdeme' && $('#GuarantorNotSelectedAgreed').val() == '0')
            {
                if ($('#Guarantor1Id').val() == 0 && $('#Guarantor2Id').val() == 0)
                {
                    if (!confirm("Kefil seçmeden devam etmek istediğinize emin misiniz? Kefil göstermeniz siparişinizin onay sürecini hızlandıracaktır.")) return false;
                    $('#GuarantorNotSelectedAgreed').val('1');
                }
            }
            if ($("#ChkConfirm").is("':checked'") == false)
            {
                alert("Lütfen sözleşmeyi onaylayınız");
                return;
            }

            if ($("#Use3D").is("':checked'") == true)
            {
                if (!confirm("Ödemenin gerçekleştirilmesi için bankanızın sayfalarına yönlendirileceksiniz. Daha önce Güvenli Alışveriş Platformu kaydınızı yapmadıysanız, bankanız önce bu kaydı yaptıracaktır. Bu aşamalarda çıkacak sorunlarda bankanızdan destek alınız.")) return false;
            }

            $('.paymentButton').css("visibility", "hidden");

            var action = $('#PaymentType').val();
            $('#SelectedAction').val(action);

            $('#frmRefresh').submit();
        }
        function frmSubmit(type)
        {
            $('.paymentButton').css("visibility", "hidden");
            if (type == 0)
            {
                $('#SelectedAction').val("");
            }
            $('#frmRefresh').submit();
        }
        function changePaymentType(type)
        {
            if (type == 1)
            {
                $('#PaymentType').val("KrediKart");
            }
            else if (type == 2)
            {
                $('#PaymentType').val("HavaleEft");
            }
            else if (type == 3)
            {
                $('#PaymentType').val("PayPal");
            }
            else if (type == 4)
            {
                $('#PaymentType').val("Mobil");
            }
            else if (type == 5)
            {
                $('#PaymentType').val("PayU");
            }
            else if (type == 6)
            {
                $('#PaymentType').val("KapidaOdeme");
            }
            else if (type == 7)
            {
                $('#PaymentType').val("AnindaKrediOdeme");
            }
            else if (type == 8)
            {
                $('#PaymentType').val("SenetleOdeme");
                //taksit sıfırla
                //$('#selectedInstallment').val(0);
            }
            frmSubmit(0);
        }


        function cargoImagesError()
        {
            $('.checkOut-inner .checkOut-section .checkout-cargo-select li .cargoInfo label img').error(function ()
            {
                var incorrectImage = $(this);
                incorrectImage.parent().html('<span>' + incorrectImage.attr('alt') + '</span>');
            });
        }

        function cartMinimalHeights()
        {
            if ($('.checkout-cart-minimal').height() < $('.checkout-view-top').height())
            {
                $('.checkout-cart-minimal').height($('.checkout-view-top').height());
            }
            else
            {
                $('.checkout-view-top').height($('.checkout-cart-minimal').height());
                //$('.checkOut-inner .checkOut-section #checkOut-view').css('border-bottom', '1px dotted #b0b0b0');
            }
        }


        function paymentChangeColors(selectedPaymentType)
        {
            if (selectedPaymentType == "KrediKart")
            {
                if ($('input[name=SelectedInstallment]:checked').val() == "1")
                {
                    $('.odmyntm').css({ 'font-weight': 'normal' });
                    $('#kktckodm').css({ 'font-weight': 'bold' });
                }
                else
                {
                    if ($('select[name=selectedInstallment]').find(':selected').val() == "1")
                    {
                        $('.odmyntm').css({ 'font-weight': 'normal' });
                        $('#kktckodm').css({ 'font-weight': 'bold' });
                    }
                    else
                    {
                        $('.odmyntm').css({ 'font-weight': 'normal' });
                        $('#tkstodm').css({ 'font-weight': 'bold' });
                    }
                }
            }
            else if (selectedPaymentType == "HavaleEft")
            {
                $('.odmyntm').css({ 'font-weight': 'normal' });
                $('#hvlftodm').css({ 'font-weight': 'bold' });
            }
            else if (selectedPaymentType == "PayPal")
            {
                $('.odmyntm').css({ 'font-weight': 'normal' });
            }
            else if (selectedPaymentType == "Mobil")
            {
                $('.odmyntm').css({ 'font-weight': 'normal' });
            }
            else if (selectedPaymentType == "PayU")
            {
                $('.odmyntm').css({ 'font-weight': 'normal' });
            }
            else if (selectedPaymentType == "KapidaOdeme")
            {
                $('.odmyntm').css({ 'font-weight': 'normal' });
                $('#kktckodm').css({ 'font-weight': 'bold' });
            }
            else if (selectedPaymentType == "SenetleOdeme")
            {
                $('.odmyntm').css({ 'font-weight': 'normal' });
                $('#senetodm').css({ 'font-weight': 'bold' });
            }
            else
            {
                $('.odmyntm').css({ 'font-weight': 'normal' });
            }
        }
        $(document).ready(function ()
        {
            paymentChangeColors($('input[name=PaymentType]:checked').val());
            cartMinimalHeights();
            cargoImagesError();
            @if (ctypeprepare)
            {
                <text>amexhazirla();</text>
            }
        });
        $(document).ajaxComplete(function ()
        {
            cartMinimalHeights();
            cargoImagesError();
        });

        $('.LoadingSmall').on('show', function ()
        {
            paymentChangeColors($('input[name=PaymentType]:checked').val());
        });
        cargoImagesError();
    </script>
    }
}
@if (checkOutStyle == 1)
{
    <script>
        function disableProcesses()
        {
            $(".chksuccess, .chkpayopts, .checkOut-cargo").css("opacity", "0.5");
            $(".chksuccess input, .chksuccess textarea, .chksuccess label, .chksuccess select, .chkpayopts input, .chkpayopts textarea, .chkpayopts label, .chkpayopts select, .checkOut-cargo input, .checkOut-cargo textarea, .checkOut-cargo label, .checkOut-cargo select").attr("disabled", "disabled").attr("onClick", "");
            $(".chkpayopts #checkOut-final, .installmentOptionsLink, .cartMinimalView td.quantity a, #checkoutForm .checkOut-section ul.checkout-cargo-select li span").css("visibility", "hidden");
            $("table#checkOut-view td.price").html("&nbsp;");
            $("select[name=selectedPos], select[name=selectedInstallment]").html("");
        }
    </script>
}
else
{
    <script>
        function disableProcesses()
        {
            $(".chksuccess, .chkpayopts, .checkOut-cargo").css("opacity", "0.5");
            $(".chksuccess input, .chksuccess textarea, .chksuccess label, .chksuccess select, .chkpayopts input, .chkpayopts textarea, .chkpayopts label, .chkpayopts select, .checkOut-cargo input, .checkOut-cargo textarea, .checkOut-cargo label, .checkOut-cargo select, .checkOut-choice a").attr("disabled", "disabled").attr("onClick", "");
            $("#checkOut-final, .installmentOptionsLink, .cartMinimalView td.quantity a, #checkoutForm .checkOut-section ul.checkout-cargo-select li span, .chkpayopts2").css("display", "none");
            $("table#checkOut-view td.price").html("&nbsp;");
            $("select[name=selectedPos], select[name=selectedInstallment]").html("");
        }
    </script>
}
@if (processesHidden)
{
    <script>
        disableProcesses();
    </script>
}
<script type="text/javascript">
    function contractview()
    {
        var cargoadresid = $("#CargoAddressId").val();
        var invoiceadresid = $("#InvoiceAddressId").val();
        var paymenttip = $('#PaymentType').val();
        var selectedpos = $('#SelectedPos').val();
        var selectedinstallment = $('#SelectedInstallment').val();
        $("#dialog-contract").load("/Cart/Contract", { CargoAddressId: cargoadresid, InvoiceAddressId: invoiceadresid, PaymentType: paymenttip, CargoPrice: '@(Model.CargoTotalPrice)', TotalPayment: '@(Model.ContractTotalPrice)', SelectedPos: '@(Model.SelectedPos)' });
    }
    function contractview2()
    {
        $("#dialog-contract").load("/Cart/DeliveryContract");
    }
    function updateAddress(id)
    {
        //$("#dialog-form").load("/Address/Update", { Id2: id });
        //$("#dialog-form").dialog("open");
        $("#address-update").load("/Address/Update", { Id2: id, isCheckout : 1 });
    }
    function updateGuarantor(id)
    {
        //$("#dialog-form").load("/Address/Update", { Id2: id });
        //$("#dialog-form").dialog("open");
        $("#guarantor-update").load("/Account/UpdateGuarantor", { Id2: id });
    }
    function OnlyCCMTAlert()
    {
        alert('Sepetinizde fırsat ürünleri bulunmaktadır, sadece kredi kartı ya da havale ile ödeme yapabilirsiniz.');
    }
    $(function ()
    {
        var agrFancyWidth = 850;
        if ($(window).width() < agrFancyWidth)
        {
            agrFancyWidth = "100%;";
        }
        var agrFancyHeight = 650;
        if ($(window).height() < agrFancyHeight)
        {
            agrFancyHeight = "100%;";
        }

        var instlFancyWidth = 1000;
        if ($(window).width() < instlFancyWidth)
        {
            agrFancyWidth = "100%;";
        }
        var instlFancyHeight = 600;
        if ($(window).height() < instlFancyHeight)
        {
            instlFancyHeight = "100%;";
        }

        var addrFancyWidth = 525;
        if ($(window).width() < addrFancyWidth)
        {
            addrFancyWidth = "100%;";
        }
        var addrFancyHeight = 400;
        if ($(window).height() < addrFancyHeight)
        {
            addrFancyHeight = "100%;";
        }

        var guarFancyWidth = 750;
        if ($(window).width() < guarFancyWidth)
        {
            guarFancyWidth = "100%;";
        }
        var guarFancyHeight = 500;
        if ($(window).height() < guarFancyHeight)
        {
            guarFancyHeight = "100%;";
        }

        $(".agreement").fancybox({
            width: agrFancyWidth,
            height: agrFancyHeight,
            fitToView: false,
            autoSize: false,
            autoDimensions: false,
            autoScale: false
        });
        $(".installmentOptionsLink").fancybox({
            width: instlFancyWidth,
            height: instlFancyHeight,
            fitToView: false,
            autoSize: false,
            autoDimensions: false,
            autoScale: false
        });

        $(".addressEdit").fancybox({
            width: addrFancyWidth,
            height: addrFancyHeight,
            fitToView: false,
            autoSize: false,
            autoDimensions: false,
            autoScale: false,
            beforeClose: function ()
            {
                frmSubmit(0);
            },
            afterClose: function ()
            {
                $("#address-update").html('');
            }
        });

        $(".guarantorEdit").fancybox({
            width: guarFancyWidth,
            height: guarFancyHeight,
            fitToView: false,
            autoSize: false,
            autoDimensions: false,
            autoScale: false,
            beforeClose: function ()
            {
            },
            afterClose: function ()
            {
                frmSubmit(0);
                $("#guarantor-update").html('');
            }
        });
    });
    //Trigger
    (function ($)
    {
        $.each(['show', 'hide'], function (i, ev)
        {
            var el = $.fn[ev];
            $.fn[ev] = function ()
            {
                this.trigger(ev);
                return el.apply(this, arguments);
            };
        });
    })(jQuery);
</script>
